#include<iostream>

using namespace std;

int main(){
	
ios_base::sync_with(false);
cin.tie(NULL);

char a,b;	
long long x,y,i;	
	
	cin >> a >> b;
	cin >> x >> y;
	
	if(abs(x-y)>=2){
	
	cout << "nemoguce";
	
	}
	else{
	
	if(x==y+1){
	for(i=1;i<=x+y;i++){
	
	if(i%2==1)
	cout << a;
	else
	cout << b;
	
  }
	
		
	}
	else{
	
	for(i=1;i<=x+y;i++){
	
	if(i%2==1)
	cout << b;
	else
	cout << a;
	
  }
	
	
 	}
		
  }
	
	
	return 0;
}