using System;

namespace ConsoleApp37
{
    class Program
    {
        static void Main(string[] args)
        {
            string ab = Console.ReadLine();
            char a = ab[0];
            char b = ab[1];
            string[] br = Console.ReadLine().Split();
            int br1 = int.Parse(br[0]);
            int br2 = int.Parse(br[1]);
            int i = 1;
            if (br1 == br2 || br1 == br2 + 1 || br2 == br1 + 1)
            {
                if (br1 > br2) Console.Write(a);
                Console.Write(b);
                Console.Write(a);

                while (i < (br1 + br2) / 2)
                {
                    Console.Write(b);
                    Console.Write(a);
                    i++;
                }
                if (br1 < br2) Console.Write(b);
            }
            else
            {
                Console.WriteLine("nemoguce");
            }
        }
    }
}