#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    string s;
    cin >> s;
    int a1, a2;
    cin >> a1 >> a2;
    if(abs(a1 - a2) > 1) cout << "nemoguce";
    else{
        int am = min(a1, a2);
        string k = "";
        for(int i = 0; i < am; i++)
            k += s;
        if(a1 < a2) cout << s[1] + k;
        else if(a1 > a2) cout << k + s[0];
        else cout << k;
    }
    return 0;
}