#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
{
    string unos,c1,c2;cin>>unos;
    c1=unos[0];c2=unos[1];
    int a1,a2;
    cin>>a1>>a2;
    int x=abs(a1-a2);
    if (x<=1)
    {

        if (a1>a2)
        {
            for (int i=0;i<a1+a2;i++)
            {
                if (i%2==0)
                cout<<c1;
                else
                cout<<c2;
            }
        }
        else if(a1<a2)
        {
            for (int i=0;i<a1+a2;i++)
            {
                if (i%2==0)
                cout<<c2;
                else
                cout<<c1;
            }
        }
        else
        {
            for (int i=0;i<a1+a2;i++)
            {
                if (i%2==0)
                cout<<c1;
                else
                cout<<c2;
            }
        }
    }
    else
    {
        cout<<"nemoguce";
    }
    return 0;
}