#include <iostream>

using namespace std;

int main()
{
    int a1,a2,i;
    string word,c1,c2;
    cin>>word;
    c1=word[0];
    c2=word[1];
    cin>>a1>>a2;
    if(a1+1==a2)
    {
        for(i=0;i<a2;i++)
        {
            cout<<c2;
            if(i<a1)
            {
                cout<<c1;
            }
        }
    }
    else if(a1==a2+1)
    {
        for(i=0;i<a1;i++)
        {
            cout<<c1;
            if(i<a2)
            {
                cout<<c2;
            }
        }
    }
    else
    {
        cout<<"nemoguce"<<endl;
    }
    return 0;
}