#include <iostream>

using namespace std;

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

        }
    }

    return 0;
}