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

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 par = c1.ToString() + c2.ToString();
                ushort br = ((ushort)((a2 + a1) / 2));
                string b = new StringBuilder(par.Length * br).Insert(0, par, br).ToString();
                if((a1 + a2) % 2 == 1) b += c1;
                Console.WriteLine(b);

            }
            else
            {
                Console.WriteLine("nemoguce");
            }
        }
    }
}