#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    char c1,c2;
    int a1,a2;
    cin>>c1>>c2>>a1>>a2;
    if (abs(a1-a2)>1) cout<<"nemoguce";
    else {
        bool b = true;
        if (a2>a1) b = false;
        for (int i=0;i<a1+a2;i++){
            if (b) cout<<c1;
            else cout<<c2;
            b = !b;
        }
    }
    return 0;
}