#include <stdio.h>
#include <ctype.h>
main()
{
	int a1,a2;
	char c1,c2;
	scanf("%c%c",&c1,&c2);
	scanf("%d %d",&a1,&a2);
	char s[a1+a2];
	if(islower(c1)&&islower(c2)&&c1!=c2&&1<=a1&&a2<=50000)
	{
		
				
				if(a2>a1||a1>=(a2+2))
				printf("nemoguce");
				else
				{
					for(int i=0;i<a1+a2;i++)
						{
							if(i%2==1)
							s[i]=c1;
							else
							s[i]=c2;
							printf("%c",s[i]);
						}
				}	
		
	}
	else
	printf("nemoguce");
}