using System;
using System.Text;

namespace Kvalifikacije___2021_11_27
{
    class Program
    {
        static void Main(string[] args)
        {
            string slova = Console.ReadLine();
            string[] brojevi = Console.ReadLine().Split();
            int a1 = Convert.ToInt32(brojevi[0]);
            int a2 = Convert.ToInt32(brojevi[1]);
            char c1 = slova[0];
            char c2 = slova[1];
            if (Math.Abs(a1 - a2) > 1)
            {
                Console.WriteLine("nemoguce");
                return;
            }
            StringBuilder builder = new StringBuilder(a1 + a2);
            if (a1 > a2)
            {
                for (int i = 0; i < a1 + a2; i++)
                {
                    if (i % 2 == 0) builder.Append(c1);
                    else builder.Append(c2);
                }
                Console.WriteLine(builder.ToString());
                return;
            }

            for (int i = 0; i < a1 + a2; i++)
            {
                if (i % 2 == 0) builder.Append(c2);
                else builder.Append(c1);
            }
            Console.WriteLine(builder.ToString());
        }
    }
}