#include <iostream>

using namespace std;

int main()
{
    char c1,c2;
    int a1,a2;
    cin>>c1;
    cin>>c2;
    cin>>a1;
    cin>>a2;
    if(c1==c2)
    {
        cout<<"nemoguce";
    }
    else if(a1==a2)
    {
        for(;a1>0;a1--)
        {
            cout<<c1<<c2;
        }
    }
    else if(a1+1==a2)
    {
        for(;a1>0;a1--)
        {
            cout<<c2<<c1;
        }
        cout<<c2;
    }
    else if(a1==a2+1)
    {
        for(;a2>0;a2--)
        {
            cout<<c1<<c2;
        }
        cout<<c1;
    }
    else
    {
        cout<<"nemoguce";
    }
    return 0;
}