using System;
using System.Text;

namespace Takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            string slova = Console.ReadLine();
            char a = slova[0];
            char b = slova[1];
            string[] br_slova = Console.ReadLine().Split();
            int bra = int.Parse(br_slova[0]);
            int brb = int.Parse(br_slova[1]);
            string a1 = a.ToString();
            string b1 = b.ToString();
            string rec = a1 + b1;

            
            if (brb == bra || bra + 1 == brb || brb + 1 == bra)
            {
                if ((bra + brb) % 2 == 0)
                {
                    int n = (bra + brb) / 2;
                    string str = new StringBuilder(rec.Length * n).Insert(0, rec , n).ToString();
                    Console.WriteLine(str); /*napravim string ab i ponavljam ga (bra+brb)/2*/
                }

                else if (bra>brb)
                {
                    int n = (bra + brb) / 2;
                    string str = new StringBuilder(rec.Length * n).Insert(0, rec, n).ToString();
                    Console.WriteLine(str + a);
                }
                else if (brb>bra)
                {
                    int n = (bra + brb) / 2;
                    string str = new StringBuilder(rec.Length * n).Insert(0, rec, n).ToString();
                    Console.WriteLine(b + str);
                }
            }
            else
            {
                Console.WriteLine("nemoguce");
            }
        }
    }
}