#include <bits/stdc++.h>
using namespace std;
int main()
{
    char c1,c2;
    cin>>c1>>c2;
    int a1,a2;
    cin>>a1>>a2;
    if(abs(a1-a2)>1)
    {
        cout<<"nemoguce"<<endl;
    }
    else
    {
        if(a1<a2)
        {
            swap(c1,c2);
            swap(a1,a2);
        }
        for(int i=0;i<a2;++i)
        {
            cout<<c1<<c2;
        }
        if(a1>a2)
            cout<<c1<<endl;
    }
}