using System;

namespace _1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char[] c = s.ToCharArray();
            string[] s1 = Console.ReadLine().Split();
            int a = int.Parse(s1[0]);
            int b = int.Parse(s1[1]);
            if (a == b || a + 1 == b || b + 1 == a)
                for (int i = 0; i < a + b; i++) 
                    if (i % 2 == 0)
                        Console.Write(c[0]);
                    else
                        Console.Write(c[1]);
            else
                Console.WriteLine("nemoguce");
        }
    }
}