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)
        {
            string c = Console.ReadLine();
            string[] a = Console.ReadLine().Split();
            char c1 = c[0];
            char c2 = c[1];
            int a1 = int.Parse(a[0]);
            int a2 = int.Parse(a[1]);
            bool na_redu = false;
            string str = "";

            if (Math.Abs(a1 - a2) < 2)
            {
                if (a1 >= a2) na_redu = true;
                while (a1 > 0 || a2 > 0)
                {
                    if (na_redu) { str += c1; a1--; }
                    else { str += c2; a2--; }
                    na_redu = !na_redu;
                }
                Console.WriteLine(str);
            }
            else Console.WriteLine("Nemoguce");
        }
    }
}