#include <iostream>

using namespace std;

int main()
{
    char a,b;
    cin>>a>>b;
    unsigned short int a1,b1;
    cin>>a1>>b1;
    if(a1<b1){
        int temp1,temp2;
        temp1=a1;
        a1=b1;
        b1=temp1;
        temp2=a;
        a=b;
        b=temp2;
    }
   if(a1-b1>1){
        cout<<"nemoguce";
    }
    else{
        int i=0;
        while(i<a1+b1){
            cout<<a;
            i++;
            if(i==a1+b1)
                break;
            cout<<b;
            i++;
        }
    }
}