using System;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char c1 = s[0];
            char c2 = s[1];
            string[] b = Console.ReadLine().Split();
            int a1 = int.Parse(b[0]);
            int a2 = int.Parse(b[1]);
            if (Math.Abs(a1 - a2) <= 1)
            {
                string rez="";
                if (a1>a2)
                {
                    rez = c1.ToString();
                    for (int i = 0; i < a2; i++)
                        rez = rez + c2 + c1;
                }
                if (a1 < a2)
                {
                    rez = c2.ToString();
                    for (int i = 0; i < a1; i++)
                        rez = rez + c1 + c2;
                }
                if (a1 == a2)
                {
                    
                    for (int i = 0; i < a1; i++)
                        rez = rez + c1 + c2;
                }
                Console.WriteLine(rez);
            }
            else
                Console.WriteLine("nemoguce");
        }
    }
}