#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)/2;
  //  cout<<y<<"\n";
    if(abs(b1-b2)<1){
        while(y--){
            cout<<c1<<c2;
        }
    }
    else{
        cout<<"nemoguce";
    }

}