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

namespace Nesusedni
{
    class Program
    {
        static void Main(string[] args)
        {
            char a = Convert.ToChar(Console.Read());
            char b = Convert.ToChar(Console.ReadLine());
            string[] s = Console.ReadLine().Split();
            int brA = Convert.ToInt32(s[0]);
            int brB = Convert.ToInt32(s[1]);
            if (Math.Abs(brA - brB) > 1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                if (brA > brB) Console.Write(a);
                for (int i = 1; i <= (brA + brB) / 2; i++)
                {
                    Console.Write(b+""+a);
                }
                if (brB > brA) Console.Write(b);
                Console.WriteLine();
            }
        }
    }
}