using System;
using System.Text;
namespace konzola
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string c1 = s[0].ToString();
            string c2 = s[1].ToString();
            string[] s1 = Console.ReadLine().Split();
            int a1 = int.Parse(s1[0]);
            int a2 = int.Parse(s1[1]);

            string c = c1 + c2;
            int a = a1 - a2;

            if (a > 1 || a < -1) Console.WriteLine("nemoguce");
            else
            {
                StringBuilder rez = new StringBuilder("", a);
                for (int i = 1; i < a1; i++) rez.Append(c);
                if (a == 1) rez.Append(c1);
                else if (a == -1)
                {
                    rez.Insert(0, c2);
                    rez.Append(c);
                }
                else if (a == 0) rez.Append(c);
                Console.WriteLine(rez);
            }
        }
    }
}