#include <iostream>

using namespace std;

int main()
{
    int pera;
    int petra;
    char perac;
    char petrac;

    cin >> perac;
    cin >> petrac;

    cin >> pera;
    cin >> petra;

    if(abs(pera - petra) > 1){
        cout << "nemoguce";
    }else{
    if(petra > pera){
            char c = perac;
            perac = petrac;
            petrac = c;
    }
        for(int i = 0; i < pera + petra; i++){
            if (i%2){
            cout << petrac;
            }else{
            cout << perac;
            }
        }
    }

    return 0;
}