#include <bits/stdc++.h>

using namespace std;

string slova;
char c1, c2;
int a1, a2, br;

int main () {
    cin >> slova >> a1 >> a2;
    c1 = slova[0];
    c2 = slova[1];
    if (a2 > a1) {
        swap(a1, a2);
        swap(c1, c2);
    }

    if (a1 - a2 > 1) cout << "nemoguce";
    else {
        for (int i = 1; i <= a1; i++){
             cout << c1;
             if (br < a2) {
                 cout << c2;
                 br++;
             }
        }
    }

return 0;
}