#include <iostream>
#include <bits/stdc++.h>
using namespace std;
string c1;
string c2;
string s;
string a;
int t;
int a1,a2;
int main () {
    cin>>s;
    cin>>a1>>a2;
    c1=s.substr(0,1);
    c2=s.substr (1,2);
    if (a1<a2-1 or a1-1>a2) {
        cout<<"nemoguce"<<endl;
    }
    else if (a1==a2) {
        for (int i=1;i<=a1;i++) {
            cout<<c1<<c2;
        }
    }
    else if (a1-1==a2) {
        for (int i=1;i<=a2;i++) {
            cout<<c1<<c2;
        }
        cout<<c1;
    }
    else if (a2-1==a1) {
        for (int i=1;i<=a1;i++) {
            cout<<c2<<c1;
        }
        cout<<c2;
    }
    return 0;
}