using System;

namespace ConsoleApp8
{
    class Program
    {
        static void Main(string[] args)
        {
            string c = Console.ReadLine();
            string[] a = Console.ReadLine().Split();
            int a1 = Convert.ToInt32(a[0]);
            int a2 = Convert.ToInt32(a[1]);
            int k = Math.Abs(a1 - a2);
            int m, n;
            if (a1 > a2)
            {
                m = 0;
                n = 1;
            }
            else
            {
                m = 1;
                n = 0;
            }
            if (k > 1)
            {
                Console.WriteLine("nemoguce");
            }
            else if (k == 1)
            {
                for (int i = 0; i < Math.Min(a1, a2); i++)
                {
                    Console.Write(c[m] + "" + c[n]);
                }
                Console.Write(c[m]);
            }
            else
            {
                for (int i = 0; i < a1; i++)
                {
                    Console.Write(c[m] + "" + c[n]);
                }
            }
        }
    }
}