using System;
using System.Diagnostics;
using System.Threading;
namespace Nesusedni
{
    class Program
    {
        static void Main(string[] args)
        {
            string c = Console.ReadLine();
            char c1 = c[0];
            char c2 = c[1];
            string[] a = Console.ReadLine().Split(' ');
            int a1 = int.Parse(a[0]);
            int a2 = int.Parse(a[1]);

            string x = "";

            if (Math.Abs(a1 - a2) > 1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                for (int i = 0; i < a1 + a2; i++) 
                {
                    if (a1 >= a2)
                    {
                        if (i % 2 == 0) x += c1.ToString();
                        else x += c2.ToString();
                    }
                    else
                    {
                        if (i % 2 != 0) x += c1.ToString();
                        else x += c2.ToString();
                    }
                }
            }
            Console.Write(x);
        }
    }
}