#include <bits/stdc++.h>

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cerr.tie(0);
    char c1, c2;
    cin >> c1 >> c2;
    int a1, a2;
    cin >> a1 >> a2;
    int r = abs(a1 - a2);
    if (r > 1)
        cout << "nemoguce";
    else
    {
        int mn = min(a1,a2);
        if (mn == a1 && mn != a2)
            cout << c2 << "";
        for (int i = 0; i < mn; i++)
            cout << c1 << "" << c2;
        if (mn != a1 && mn == a2)
            cout << c1 << "";
    }
    return 0;
}