#include <iostream>
#include <cmath>

using namespace std;
int main() {
    char a, b;
    cin >> a >> b;
    int c, d;
    cin >> c >> d;
    if (abs(c-d) > 1) {
        cout << "nemoguce";
        return 0;
    }
    bool asd = c > d;
    int sum = a + b;
    for (int i = 0; i < sum; i++) {
        if (asd) {
            if (c == 0)
                return 0;
            cout << a;
            c--;
            asd = false;
        } else {
            if (d == 0)
                return 0;
            cout << b;
            d--;
            asd = true;
        }
    }
    return 0;
}