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

namespace Takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            string n = Console.ReadLine();
            int i;
            string r;
            r = "";
            string max;
            char a = n[0];
            char b = n[1];
            string m = Console.ReadLine();
            int p = (int)char.GetNumericValue(m[0]);
            int q = (int)char.GetNumericValue(m[2]);
            max = a.ToString() + b.ToString();
            if (Math.Abs(p - q) > 1)
                Console.WriteLine("Nemoguce");
            else
            {
                if (p > q)
                {
                    r = r + a;
                    max = b.ToString() + a.ToString();
                }

                else
                    if (q > p)
                {
                    r = r + b;

                    max = a.ToString() + b.ToString();
                }

                for (i = 1; i <= (p + q) / 2; i++)
                    r = r + max;
                Console.WriteLine(r);
            }
            Console.ReadLine();
        }
    }
}