#include<stdio.h>
#include<stdlib.h>
int main(){
	char slova[2];
	int br1,br2;
	scanf("%2s",slova);
	scanf("%d %d",&br1,&br2);
	if((br1-br2)>=2||(br2-br1)>=2||br1<=0||br2<=0){
		printf("nemoguce");
		return 0;
	}
		for(int i=0;i<br1+br2;i++)
		{
			if(i%2!=0)
				printf("%c",slova[0]);
			else
				printf("%c",slova[1]);
		}
	printf("\n");
	system("pause");
	return 0;
}