#include <iostream>
#include <string>
#include <ctime>

using namespace std;

int main()
{
    srand(time(0));
    string be;
    cin>>be;
    string be1=be.substr(0,1);
    string be2=be.substr(1);
    int szam1,szam2,i=0,k;
    cin>>szam1>>szam2;
    if(szam1+2<=szam2 || szam2+2<=szam1)
        cout<<"nemoguce"<<endl;
    else
    {
        string a[szam1+szam2];
        for(i=0;i<szam1*szam2;i++)
        {

            //cout<<endl<<"eleje"<<endl;
            k=rand()%2+1;
            //cout<<k;
            if(k==1)
                a[i]=be1;
            else
                a[i]=be2;
            if(a[i]==a[i-1])
            {
                i--;
                continue;
            }
            cout<<a[i];
        }
    }



    return 0;
}