using System;
using System.Linq;

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char[] c = s.ToCharArray();
            char c1 = c[0];
            char c2 = c[1];

            string[] l = Console.ReadLine().Split();
            int a1 = int.Parse(l[0]);
            int a2 = int.Parse(l[1]);

            string done = "";
            if (a1 == a2)
            {
                done = string.Concat(Enumerable.Repeat(s, a1));
                Console.WriteLine(done);
            }
            if (a1 != a2)
            {
                if (Math.Abs(a1 - a2) == 1)
                {
                    if (a1 > a2)
                    {
                        done = string.Concat(Enumerable.Repeat(s, a1));
                        done += c1;
                        Console.WriteLine(done);
                    }
                    else
                    {
                        done += c2;
                        done += string.Concat(Enumerable.Repeat(s, a1));
                        Console.WriteLine(done);
                    }
                }
                else
                    Console.WriteLine("nemoguce");
            }
        }
    }
}