using System;
using System.Collections;
using System.Linq;
using System.Collections.Generic;

namespace Zadaci
{
    class Program
    {
        static void Main()
        {
            char c1, c2;
            ushort a1, a2;
            char[] chr = Console.ReadLine().ToCharArray();
            string[] cnt = Console.ReadLine().Split(' ');
            c1 = chr[0];
            c2 = chr[1];
            a1 = ushort.Parse(cnt[0]);
            a2 = ushort.Parse(cnt[1]);
            if (Math.Abs(a1 - a2) < 2)
            {
                string c = "";
                while(a1 > 0 && a2 > 0)
                {
                    if(a1 > 0)
                    {
                        c += c1;
                        a1--;
                    }
                    if (a2 > 0)
                    {
                        c += c2;
                        a2--;
                    }
                }
                Console.WriteLine(c);
            }
            else
            {
                Console.WriteLine("nemoguce");
            }
        }
    }
}