#include <bits/stdc++.h>

using namespace std;

int main()
{
    char c1, c2;

    cin >> c1 >> c2;

    unsigned short a1, a2;

    cin >> a1 >> a2;

    char str[a1+a2];

    if(abs(a1-a2) == 0 || abs(a1-a2) == 1){
        int maxA1 = a1 > a2;
        char *str = (char*)calloc(a1+a2, sizeof(char));
        for (int i = 0; i < a1+a2;i++) {
            str[i] = i%2 == 0 ? maxA1 ? c1 : c2 : maxA1 ? c2 : c1;
        }
        cout << str;
    }
    else cout << "nemoguce";

    return 0;
}