#include <iostream>

using namespace std;

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

    return 0;
}