#include <iostream>
#include <cstring>
using namespace std;
bool razlika(long int x,long int y){
if(x>y)
    return x-y<2;
    else
        return y-x<2;
}

int main()
{
    char c[2],c1[2],c2[2];
    long int a1,a2;
    cin>>c;
    cin>>a1>>a2;
    strcpy(c1,c);
    c1[1]=NULL;
    strcpy(c2,c+1);
    if(!razlika(a1,a2))
        cout<<"nemoguce";
        else
            if(a1>a2)
             for(int i=0;i<a1+a2;i++){
              if(i%2==0)
              cout<<c1;
              else
                cout<<c2;
             }
             else
                for(int i=0;i<a1+a2;i++){
                if(i%2==0)
                cout<<c2;
             else
                cout<<c1;}
   return 0;

}