CodeForces

来源:互联网 发布:天猫实时大数据 编辑:程序博客网 时间:2024/06/05 18:17

zscoder loves simple strings! A string t is called simple if every pair of adjacent characters are distinct. For example ab, aba, zscoder are simple whereas aa, add are not simple.
zscoder is given a string s. He wants to change a minimum number of characters so that the string s becomes simple. Help him with this task!

Input
The only line contains the string s (1 ≤ |s| ≤ 2·105) — the string given to zscoder. The string s consists of only lowercase English letters.

Output
Print the simple string s’ — the string s after the minimal number of changes. If there are multiple solutions, you may output any of them.
Note that the string s’ should also consist of only lowercase English letters.

Example

Input
aab

Output
bab

Input
caaab

Output
cabab

Input
zscoder

Output
zscoder

#include"stdio.h"int main(){    char ai[300000],chu;    int i,j,k,sum;    scanf("%s",ai);    for (i=0;ai[i]!='\0';i++)    {        sum=1;        j=i;        while (ai[i]==ai[i+1])        {            sum++;            i++;        }        for (k=j+1;k<=i;k=k+2)        {            chu='a';            ai[k]=chu;            while (ai[k]==ai[k+1]||ai[k]==ai[k-1])            {                chu++;                ai[k]=chu;            }        }    }    printf("%s\n",ai);    return 0;}
0 0
原创粉丝点击