using System;

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 rez = "";
            string c = c1 + c2;
            int a = a1 - a2;
            if (a > 1 || a < -1) Console.WriteLine("nemoguce");
            else
            {
                for (int i = 0; i < a1 - 1; i++) rez += c;
                if (a == 1) rez += c1;
                else if (a == -1) rez = c2 + rez + c;
                else if (a == 0) rez += c;
                Console.WriteLine(rez);
            }
        }
    }
}