#include <bits/stdc++.h>

#define pb push_back
#define ll long long
#define pii pair<int, int>
#define xx first
#define yy second

using namespace std;

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

    string s, ress; cin>>s; ress="";
    int a, b; cin>>a>>b;
    if (abs(a-b)>1) { cout<<"nemoguce"; exit(0); }
    if (b>a) { swap(s[0], s[1]); swap(a, b); }

    for (int i=0; i<(a+b); i++)
    {
        if (i%2==0) ress+=s[0];
        else ress+=s[1];
    }

    cout<<ress;

}