#include <bits/stdc++.h>

using namespace std;

int main() {

    char c1, c2;
    int a1, a2;

    string karakteri;

    cin >> karakteri;

    cin >> a1 >> a2;

    c1 = karakteri[0];
    c2 = karakteri[1];

    if(abs(a1 - a2) <= 1) {
        for(int i = 0; i < a1 + a2; i++) {
            if(i % 2 == 0) {
                cout << c2;
            } else {
                cout << c1;
            }
        }
    } else {
        cout << "nemoguce";
    }

    return 0;
}