#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    char c1,c2;
    cin>>c1>>c2;
    int a1,a2;
    cin>>a1>>a2;

    if(abs(a1-a2)>1){
        cout<<"nemoguce"<<endl;
        return 0;
    }
    if(a2>a1) cout<<c2;
    for(int i=1;i<a1+a2;i+=2){
        cout<<c1<<c2;
    }
    if(a1>a2) cout<<c1;

    cout <<  endl;
    return 0;
}