#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s, s1 = "";
    int a,b;
    cin >> s;
    cin >> a >> b;
    if(abs(a - b) <= 1){
        if(b > a){
            s1 += s[1];
            b--;
        }
        while(a && b){
            s1 += s;
            a--;
            b--;
        }
        if(a > b){
            s1 += s[0];
        }

    }
    else
        s1 = "nemoguce";
    cout << s1;
    return 0;
}