using System;

namespace prvi_zadatak_kvalifikacije_1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            char c1 = s1[0];
            char c2 = s1[1];
            string[] s2 = Console.ReadLine().Split(' ');
            int a1 = int.Parse(s2[0]);
            int a2 = int.Parse(s2[1]);
            if (Math.Abs(a1 - a2) > 1) Console.WriteLine("nemoguce");
            else
            {
                char t1 = c1;
                char t2 = c2;
                if (a2 > a1)
                {
                    t2 = c1;
                    t1 = c2;
                }
                for (int i = 0; i < a1 + a2; i++)
                {
                    if (i % 2 == 0) Console.Write(t1);
                    else Console.Write(t2);
                }
            }
        }
    }
}