#include <bits/stdc++.h>
using namespace std;
#define endl '\n'

void solve(){
    char a, b;
    cin >> a >> b;
    int x, y;
    cin >> x >> y;

    if (x < y){
        swap(x, y);
        swap(a, b);
    }

    if (x - y > 1){
        cout << "nemoguce" << endl;
        return;
    }

    while (y){
        cout << a << b;
        --y, --x;
    }
    if (x) cout << a;
    cout << endl;
}

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

    solve();

    return 0;
}