#include<stdio.h>
#include<string.h>
int main(){
	int x,y,i,j=1;
	char k,g;
	scanf("%c%c",&k,&g);
	scanf("%d%d",&x,&y);
	char a[x+y];
	if(x==y+1 or x==y){
		for(i=0;i<y+x;i=i+2){
			a[i]=k;
			if(i==x+y-1)break;
			a[j]=g;
			j=j+2;
		}
	}
	else if(x==y-1){
		for(i=0;i<y+x;i=i+2){
			a[i]=g;
			if(i==x+y-1)break;
			a[j]=k;
			j=j+2;
	}
	}
	else printf("nemoguce\n");
	puts(a);
	return 0;
}