using System;

namespace Nesusedni
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            char[] c = x.ToCharArray();
            char c1 = c[0];
            char c2 = c[1];
            string[] array=Console.ReadLine().Split(' ');
            int a1 = Convert.ToInt32(array[0]);
            int a2 = Convert.ToInt32(array[1]);
            if (Math.Abs(a1 - a2) <= 1)
            {
                if (a1 > a2)
                {
                    Console.Write(c1);
                }
                else if (a2 > a1)
                {
                    Console.Write(c2);
                    char temp = c1;
                    c1 = c2;
                    c2 = temp;
                }
                int m = Math.Min(a1, a2);
                for (int i = 0; i < m; i++)
                {
                    Console.Write("{0}{1}",c2, c1);
                }
            }
            else Console.Write("nemoguce");
        }
    }
}