#include<bits/stdc++.h>

using namespace std;

char c1,c2;
int a1,a2;
string s;

int main()
{
    cin>>c1>>c2;
    cin>>a1>>a2;

    if(abs(a1-a2)>1)
    {
        cout<<"nemoguce"<<endl;
    }
    else
    {
        s="";
        if(a1>a2)
        {
            s+=c1;
            while(a2>0)
            {
                s+=c2;
                s+=c1;
                a2--;
            }
        }
        else if(a2>a1)
        {
            s+=c2;
            while(a1>0)
            {
                s+=c1;
                s+=c2;
                a1--;
            }
        }
        else
        {
            while(a1>0)
            {
                s+=c1;
                s+=c2;
                a1--;
            }
        }
        cout<<s<<endl;
    }

    return 0;
}