#include <iostream>

using namespace std;

int main()
{
    int a=0;
    char c1;
    char c2;
    int a1;
    int a2;
    cin>>c1>>c2;
    cin>>a1;
    cin>>a2;
    if(c1==c2||a1<0||a1>50000||a2<0||a2>50000||c1>122||c1<97||c2>122||c2<97||abs(a1-a2)>1)
    {
        cout<<"nemoguce"<<endl;
    }
    else
    {
        if(a1=a2)
        {
            for(int i=0;i<a1;i++)
            {
                cout<<c1<<c2;
            }
        }
        else if(a1>a2)
        {
            while(a<a2)
            {
                cout<<c1<<c2;
            }
            cout<<c1;
        }
        else
        {
            while(a<a1)
            {
                cout<<c2<<c1;
            }
            cout<<c2;
        }
    }
    return 0;
}