#include <iostream>

using namespace std;

int main()
{
    string s,s1,s2;
    int b1,b2;
    cin>>s;
    s1=s[0];
    s2=s[1];
    cin>>b1>>b2;
    if(b1>b2+1 || b2>b1+1)
    {
        cout<<"nemoguce";
        return 0;
    }
    else
    {
        if(b1==b2)
        {
            int pom=b1+b2;
            while(pom>0)
            {
                if(pom%2==0)
                {
                    cout<<s1;
                }
                else
                {
                    cout<<s2;
                }
                pom--;

            }
            return 0;
        }
        else
        {
            int br=0;
            if(b1>b2)
            {
                while(br<b1+b2)
                {
                    if(br%2==0)
                    {
                        cout<<s1;
                    }
                    else
                    {
                        cout<<s2;
                    }
                    br++;
                }
            }
            else
            {
                while(br<b1+b2)
                {
                    if(br%2==0)
                    {
                        cout<<s2;
                    }
                    else
                    {
                        cout<<s1;
                    }
                    br++;
                }

            }
        }
    }
}