#include <bits/stdc++.h>

#define ll long long
#define pb push_back

using namespace std;

#pragma GCC optimize("Ofast,unroll-loops")

string multiply_strings(char c1, char c2, ll length) {
    string ans = "";
    
    for(ll i = 0; i < length; i++) {
        if (i % 2 == 0) {
            ans += c1;
        } else {
            ans += c2;
        }
    }

    return ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    char c1, c2;
    ll a1, a2;
    cin >> c1 >> c2;
    cin >> a1 >> a2;

    if(abs(a1 - a2) <= 1) {
        if (a1 > a2) {
            cout << multiply_strings(c1, c2, a1 + a2);
        } else {
            cout << multiply_strings(c2, c1, a1 + a2);
        }
    } else {
        cout << "nemoguce";
    }

    return 0;
}