#include <iostream>

using namespace std;

int main()
{
    string ab;
    cin >> ab;
    char a = ab[0];
    char b = ab[1];
    int n1, n2;
    cin >> n1 >> n2;

    if(n1 < n2) {
        int pom = n2;
        n2 = n1;
        n1 = pom;
        char pomc = a;
        a = b;
        b = pomc;
    }
    if(n1-n2 > 1) {
        cout << "nemoguce";
    }else {
        for(int i = 0; i < n1+n2; i++) {
            if(i%2 == 0) {
                cout << a;
            }else {
                cout << b;
            }
        }
    }
}