using System;

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