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 = 0;
            if (br1 == br2 || br1 == br2 + 1 || br2 == br1 + 1)
            {
                while (i < br1 + br2)
                {
                    if (br1 > br2 && i == 0)
                    {
                        Console.Write(b);
                    }
                    else if (br2 > br1 && i == 0)
                    {
                        Console.Write(a);    
                    }
                    Console.Write(a);
                    Console.Write(b);
                    i += 2;
                }
            }
            else
            {
                Console.WriteLine("nemoguce");
            }
        }
    }
}