using System;

namespace Zadatak1
{
    class Program
    {
        static void Main(string[] args)
        {
            string st = Console.ReadLine();
            char s1 = st[0];
            char s2 = st[1];
            st = "";
            string[] sts = Console.ReadLine().Split(' ');
            int a1 = int.Parse(sts[0]);
            int a2 = int.Parse(sts[1]);
            int u = a1+a2;
            int p1 = a1;
            int p2= a2;
            if (Math.Abs(a1 - a2) < 2)
            {
                for(int i=0;i<u;i++)
                {
                    if(i%2==0)
                    {
                        if (a1 > a2) st += s1;
                        else st += s2;
                    }
                    else
                    {
                        if (a1 > a2) st += s2;
                        else st += s1;
                    }
                }
            }
            else st = "nemoguce";
            Console.WriteLine(st);
        }
    }
}