using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace nesusedni
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string c1 = s.Substring(0,1);
            string c2 = s.Substring(1);
            string [] a = Console.ReadLine().Split(' ');
            int a1 = int.Parse(a[0]);
            int a2 = int.Parse(a[1]);
            string t = "";
            if (a1 == a2)
            {
                while (a1 > 0)
                {
                    t += c1;
                    t += c2;
                    a1--;
                }
            }
            else if (a1 == a2 + 1)
            {
                t += c1;
                while (a1 > 1)
                {
                    t += c2;
                    t += c1;
                    a1--;
                }
                
            }
            else if (a2 == a1 + 1)
            {
                t += c2;
                while (a2 > 1)
                {
                    t += c1;
                    t += c2;
                    a2--;
                }
            }
            else
            {
                Console.WriteLine("nemoguce");
            }
            Console.WriteLine(t);
        }   
    }
}