#include<stdio.h>
#include<string.h>

char str[100] = "abacba";

int check()
{
	int i;
	for(i = 0 ; i < strlen(str)-1 ; i++)
	{
		if(str[i] != str[i+1])
		{
			return 1;
		}
	}
	return 0;
}

int main()
{
	int i;
	int j;
	while(check())
	{
		for(i = 0 ; i < strlen(str) ; i++)
		{
			if(str[i]+str[i+1] == 'a'+'b')
			{
				str[i] = 'c';
			}
			else if(str[i]+str[i+1] == 'b'+'c')
			{
				str[i] = 'a';
			}
			else if(str[i]+str[i+1] == 'c'+'a')
			{
				str[i] = 'b';
			}

			j = i+1;
			while(j < strlen(str)-1)
			{
				str[j] = str[j+1];
				j++;
			}
			str[j] = '\0';
		}
	}
	printf("%s" , str);
	return 0;
}