#include <bits/stdc++.h>

using namespace std;

int main()
{
    char c1,c2;
    cin>>c1>>c2;
    int b1,b2;
    cin>>b1>>b2;
    int x=abs(b1-b2);
    int y=(b1+b2);
    int b=y/2;
   // cout<<y;
    int z=y+1;
  //  cout<<y<<"\n";
    if(abs(b1-b2)<=1){
        if(y % 2 == 0){
            while(b--){
            cout<<c1<<c2;

        }
        }
            else{
                     while(b--)
                    {
                    cout<<c1<<c2;

                    }
                cout<<c1;
                }
        }


    /*else if(abs(b1-b2)==1){
         while(z--){
            cout<<c1<<c2;

        }
    }*/
    else{
        cout<<"nemoguce";
    }

}