using System;
//using System.Diagnostics;

namespace Takmicenje_27._11._2021_
{
    class Program
    {
        static void Main(string[] args)
        {
            /*Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();*/
            
            string s = Console.ReadLine();
            string c1 = Convert.ToString(s[0]);
            string c2 = Convert.ToString(s[1]);
            string[] s1 = Console.ReadLine().Split();
            int a1 = Convert.ToInt32(s1[0]);
            int a2 = Convert.ToInt32(s1[1]);
            s = "";

            if (Math.Abs(a1 - a2) > 1) Console.WriteLine("nemoguce");
            else
            {
                if (Math.Abs(a1-a2)==0)
                {
                    for (int i=0;i<a1;i++)
                    {
                        s += c1 + c2;
                    }
                }
                else if (Math.Abs(a1 - a2) == 1)
                {
                    if (a1>a2)
                    {
                        for (int i=0;i<a1+a2;i++)
                        {
                            if (i % 2 == 0) s += c1;
                            else s+= c2;
                        }
                    }
                    else
                    {
                        for (int i = 0; i < a2+a1; i++)
                        {
                            if (i % 2 == 0) s += c2;
                            else s += c1;
                        }
                    }
                }
            }
            Console.WriteLine(s);
            /*stopwatch.Stop();

            Console.WriteLine("Elapsed Time is {0} ms", stopwatch.ElapsedMilliseconds);*/
        }
    }
}