#include <bits/stdc++.h>
using namespace std;
string s,c;
int a1,a2;
int main(){
    cin>>s;
    cin>>a1>>a2;
        if(a1==a2){
           for(int i=1;i<=a1;i++){
               c+=s;
           }
           cout<<c<<endl;
        }
        else if(a1==a2+1){
           for(int i=1;i<=a2;i++){
               c+=s;
           }
           cout<<c+s[0]<<endl;
        }
        else if(a1+1==a2){
           for(int i=1;i<=a1;i++){
               c+=s;
           }
           cout<<s[1]+c<<endl;
        }
        else
           cout<<"nemoguce"<<endl;

    return 0;
}