#include <bits/stdc++.h>
using namespace std;
string c1,c2,s,a,res;
int x,y,br;
int main(){
    s=c1+c2;
    cin>>s;
    cin>>x>>y;
    br=x+y;
    for(int i=0; i<br/2; i++){
        a+=s;
        if(a[i]!=a[i+1] and (x==y or (x==y+1 or y==x+1))){
                res=a;
        }
        else{
            res="nemoguce";
        }
    }
    cout<<res<<endl;
    return 0;
}