#include <iostream>
using namespace std;

string r;


int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	bool moguce = true;
	char c1,c2;
	int a1,a2,max,k = 1;
	
	
	cin >> c1 >> c2;
	
	cin >> a1 >> a2;
	
max = a1;
if(a2 > max){
 max = a2;
 k = -k;
}
	
for(int i = 0; i < 2 * max; i++){
	
	if(k == 1 && a1 > 0){
		
		r += c1;
		a1--;
		
	}else{
		
		if(a2 > 0){
		r += c2;
		a2--;
		}
	}
	
	if((a1==0 || a2==0) && (a1 > a2 + 1 || a2 > a1 + 1))moguce = false;
	
	k = -k;
	
}

if(moguce == true)cout<<r<<'\n';
else cout<<"nemoguce"<<'\n';

	return 0;
}