#include <iostream>
using namespace std;

int main(){
	char c1,c2;
	int a1,a2;
	string x ="";
	cin>>c1>>c2;
	cin>>a1>>a2;
	if((a1-a2>0?a1-a2:a2-a1)<2){
		if(a1>a2){
			for(int i=0;i<a1+a2;i++){
				if(i%2==0)x+=string(1,c1);
				else x+=string(1,c2);
		    }
		    cout<<x;
		}
		else{
			for(int i=0;i<a1+a2;i++){
				if(i%2==0)x+=string(1,c2);
				else x+=string(1,c1);
			}
			cout<<x;
		}
    }
	else cout<<"nemoguce";
}