#include <iostream>
using namespace std;
main(){
    int a1,a2;
    char c1,c2;
    string s;
    cin>>c1; cin>>c2; cin>>a1; cin>>a2;
    if((a1-a2<2)&&(a2-a1<2))
	{
        if(a1>=a2)
		{
            if(a1>a2)
			{
                s=c1;
                while(a1!=1)
				{
                   	a1--;
                   	s+=c2;
                   	s+=c1;
                	}
                cout<<s;
            	}
           		else{
                while(a1!=0)
				{
                    a1--;
                    s+=c2;
                    s+=c1;
                	}
                cout<<s;
           		    }
        		  }
        	else{
            s=c2;
            while(a2!=1)
			{
                a2--;
                s+=c1;
                s+=c2;
            	}
            cout<<s;
        }
    }
	else{
        cout<<"nemoguce";
    }
}