#include <iostream>
using namespace std;

int main(){
	char c1,c2;
	int a1,a2;
	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)cout<<c1;
				else cout<<c2;
		    }
		}
		else{
			for(int i=0;i<a1+a2;i++){
				if(i%2==0)cout<<c2;
				else cout<<c1;
			}
		}
    }
	else cout<<"nemoguce";
	system("pause");
	return 0;
}