using System;

namespace Takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            string c1 = str[0].ToString();
            string c2 = str[1].ToString();
            string[] str1 = Console.ReadLine().Split();
            int a1 = int.Parse(str1[0]);
            int a2 = int.Parse(str1[1]);
            int zbir = a1 + a2;
            string slova = "";
            while (a1 > 0 && a2 > 0)
            {
                slova += c1 + c2;
                a1--;
                a2--;
            }
            if (slova.Length == zbir || slova.Length == zbir - 1 || slova.Length == zbir + 1)
                Console.WriteLine(slova);
            else if (slova.Length < zbir || slova.Length > zbir)
                Console.WriteLine("nemoguce");
        }
    }
}