#include <bits/stdc++.h>

using namespace std;

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

    return 0;
}