#include <iostream>

using namespace std;

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