#include <iostream>

using namespace std;

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