using System;

namespace _1._Zadatak
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            str.Split();
            char Pera=str[0];
            char Petra = str[1];
            string[] brojevi = Console.ReadLine().Split();
            int broj1 = int.Parse(brojevi[0]);
            int broj2 = int.Parse(brojevi[1]);
            
            if(Math.Abs(broj1-broj2) > 1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                if (broj1 > broj2)
                {
                    for(int i = 0; i < broj2; i++)
                    {
                        Console.Write(Pera.ToString() + Petra.ToString()) ;
                           
                    }
                    Console.Write(Pera.ToString());
                }
                else if (broj2>broj1)
                {
                    for (int i = 0; i < broj1; i++)
                    {
                        Console.Write(Petra.ToString() + Pera.ToString());

                    }
                    Console.Write(Petra.ToString());
                }
                else
                {
                    for(int i = 0; i < broj1;i++)
                    {
                        Console.Write(Pera.ToString() + Petra.ToString());
                        
                    }
                }
            }
            
            Console.ReadLine();

        }
    }
}