#include<stdio.h>
#include<string.h>
int main(){
	char c1, c2, string[100000];
long a1, a2;
int i,j;
    scanf("%c%c",&c1,&c2);
	scanf("%d %d",&a1,&a2);
	if(a1>a2+1 or a2>a1+1) {
		printf("nemoguce");
		
	}
	else if(a1==a2){
	for(i=0;i<a1+a2;i=i+2){
		string[i]=c1;
		string[i+1]=c2;
	}
	printf("%s", string);
	}
 	else {
 		if(a1>a2){
     		for(i=0;i<a1+a2-1;i=i+2){
		string[i]=c1;
		string[i+1]=c2;
	}
	string[a1+a2-1]=c1;
	printf("%s", string);
		}
		else {
	 		for(i=0;i<a1+a2-1;i=i+2){
		string[i]=c2;
		string[i+1]=c1;
	}
	string[a1+a2-1]=c2;
	printf("%s", string);
			
		}
}
	return 0;
}