using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string c1 = s[0].ToString();
            string c2 = s[1].ToString();
            s = "";
            string[] str = Console.ReadLine().Split();
            int a1 = int.Parse(str[0]);
            int a2 = int.Parse(str[1]);
            if (Math.Abs(a1 - a2) > 1) Console.WriteLine("nemoguce");
            else
            {
                if (a1 < a2)
                {
                    s = c2;
                    a2--;
                }
                while (a2 > 0)
                {
                    s += c1 + c2;
                    a2--;
                }
                if (a1 > s.Length / 2) s += c1;
                Console.WriteLine(s);
            }    
        }
    }
}