#include <iostream>

using namespace std;

int main()
{
    string s;
    int a, b;
    cin >> s;
    scanf("%u %u", &a, &b);
    int d = abs(a - b);
    if (d > 1) {
        cout << "nemoguce";
    }
    else {
        if (d == 0) {
            for (int i = 0; i < a; i++) {
                cout << s;
            }
        }
        else {
            if (a > b) {
                for (int i = 0; i < b; i++) {
                    cout << s;
                }
                cout << s[0];
            }
            else {
                for (int i = 0; i < a; i++) {
                    cout << s[1] << s[0];
                }
                cout << s[1];
            }
        }
    }
}