#include <iostream>

using namespace std;


int main()
{
    string out = "";
    char c1;
    char c2;
    int a1;
    int a2;
    cin >> c1;
    cin >> c2;
    cin >> a1;
    cin >> a2;
    int maks = max(a1, a2);
    int mini = min(a1, a2);
    if (maks - 1 > mini){
        cout << "nemoguce" << endl;
    }else if(a1 == a2){
        for (int i=0;i<a1;i++){
            out += c1;
            out += c2;
        }
        cout << out << endl;
    }else{
        if (maks == a1){
            for (int i=0;i<a1-1;i++){
            out += c1;
            out += c2;
        }
        out += c1;
        cout << out << endl;
        }else{
            for (int i=0;i<a2-1;i++){
                out += c2;
                out += c1;
            }
            out += c2;
            cout << out << endl;

    }
}
}