#include <bits/stdc++.h>

using namespace std;

int main(){

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

    int a1, a2;
    char c1, c2;
    string s;

    cin>>s;
    c1=s[0];
    c2=s[1];
    cin>>a1>>a2;

    if(abs(a1-a2)>1){
        cout<<"nemoguce";
        return 0;
    }

    if(a1>a2){
        while(a1){
            cout<<c1;
            if(a1>1){
                cout<<c2;
            }
            a1--;
        }
    }else if(a2>a1){
        while(a2){
            cout<<c2;
            if(a2>1){
                cout<<c1;
            }
            a2--;
        }
    }else{
        while(a1){
            cout<<c1<<c2;
            a1--;
        }
    }

}