#include <bits/stdc++.h>
using namespace std;

int a1, a2;
string s1, s2;

int main() {
        ios_base::sync_with_stdio(false);
        cin.tie(0); cout.tie(0);

        cin >> s1;
        cin >> a1 >> a2;

        if (a1 - a2 > 1 || a2 - a1 > 1) cout << "nemoguce";
        else if (a1 - a2 == 1) {
                while (a1 != 0) {
                        if (a1 > 1) {
                            s2.push_back(s1[0]);
                            s2.push_back(s1[1]);
                        }
                        else if (a1 == 1) s2.push_back(s1[0]);
                        a1--;
                }
                cout << s2;
        }
        else if (a2 - a1 == 1) {
                while (a2 != 0) {
                        if (a2 > 1) {
                            s2.push_back(s1[0]);
                            s2.push_back(s1[1]);
                        }
                        else if (a2 == 1) s2.push_back(s1[1]);
                        a2--;
                }
                cout << s2;
        }
        else if (a1 == a2) {
                while (a1 != 0 && a2 != 0) {
                        s2.push_back(s1[0]);
                        s2.push_back(s1[1]);
                        a1--;
                        a2--;
                }
                cout << s2;
        }
        return 0;
}