#include <bits/stdc++.h>

using namespace std;

int main()
{
    char c1, c2;
    long long a1, a2, brk = 0;
    cin >> c1 >> c2 >> a1 >> a2;
    if(a1 - a2  > 1 || a2 - a1 > 1){
       cout << "nemoguce"; 
    } 
    else if(a1 == a2){
            while(brk != a1 + a2){
            cout << c1;
            brk++;
            cout << c2;
            brk++;
        }
    }

    else if(a1 - a2 == 1){
        while(brk != (a1 + a2) - 1){
            cout << c1;
            brk++;
            cout << c2;
            brk++;
        }
        cout << c1;
    }
    else if(a2 - a1 == 1){
        while(brk != (a1 + a2) - 1){
            cout << c2;
            brk++;
            cout << c1;
            brk++;
        }
        cout << c2;
    }

    return 0;
}