#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long a1, a2, b1, b2;
    string s;
    cin >> s;
    cin >> a1>>a2;
    b1 = a1;
    b2 = a2;
    if(a1-2 >= a2 || a2-2 >= a1)
        cout << "nemoguce";
    else
        if(a1>a2){
            cout << s[0];
            while(b2>0){
                cout << s[1];
                b2--;
                cout << s[0];}}
        if(a2>a1){
            cout << s[1];
            while(b1>0){
                cout << s[0];
                b1--;
                cout << s[1];}}
    if(a1==a2)
        while(a1>0){
            cout << s[0];
            a1--;
            cout << s[1];
        }
    return 0;
}