using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            char s1;
            char s2;
            int br1;
            int br2;
            string s = Console.ReadLine();
            char[] niz = s.ToCharArray();
            s1 = niz[0];
            s2 = niz[1];
            s = Console.ReadLine();
            string[] str = s.Split(' ');
            br1 = int.Parse(str[0]);
            br2 = int.Parse(str[1]);


            if (Math.Abs(br1 - br2) >= 2)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                if (br1 > br2)
                {
                    while (br1 > 1)
                    {
                        Console.Write(s1);
                        Console.Write(s2);
                        br1--;
                    }
                    Console.Write(s1);
                }
                else if (br2 > br1)
                {
                    while (br2 > 1)
                    {
                        Console.Write(s2);
                        Console.Write(s1);
                        br2--;
                    }
                    Console.Write(s2);
                }
                else if (br1 == br2)
                {
                    while (br2 > 0)
                    {
                        Console.Write(s2);
                        Console.Write(s1);
                        br2--;
                    }
                }

            }



           // Console.WriteLine(s1 + " " + br1 + " " + s2 + " " + br2);
            Console.ReadLine();
            

        }
    }
}