#include <iostream>
#include <string>
#include <cmath>
using namespace std;
string rec;
int main(){
    int x, y;
    cin>>rec;
    cin>>x;
    cin>>y;
    int i=0;
    int i1, i2;
   
    i1=x;
    i2=y;
    if(abs(x-y)>1){
        cout<<"nemoguce"<<'\n';
    }else{
       if(i1==i2){
           while(i<i1){
               cout<<rec[0]<<rec[1];
               i++;
           } 
           
       }else if(i2>i1){
           cout<<rec[1];
           i2=y-1;
           while(i<i2){
               cout<<rec[0]<<rec[1];
               i++;
           }
       }else if(i1>i2){
           cout<<rec[0];
           i1=x-1;
           while(i<i1){
               cout<<rec[1]<<rec[0];
               i++;
           } 
             }
       } 
    

  return 0;
}