#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    string s, c1, c2, k;
    int a1, a2;
    cin >> s;
    c1 = s [0];
    c2 = s [1];
    //cout << c1 << "\n" << c2 << endl;
    cin >> a1 >> a2;
    int i = a1 + a2;
    if (abs(a1 - a2) > 1) cout << "nemoguce";
    else {
        if (a1>a2) {
            while (i){
               if (i>=2) {
                cout << s;
                i-=2;
               }
               else {
                cout << c1;
                i--;
               }
            }
        }
        else {
            string str = c2 + c1;
            while (i){
                if (i>=2){
                    cout << str;
                    i-=2;
                }
                else {
                    cout << c2;
                    i--;
                }
            }
        }

    }
    return 0;
}