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

namespace ConsoleApp4
{
    internal class Program
    {
        static void ispis(string n, int n2, string m, int m2)
        {
            for(int i = 0; i < n2; i++)
            {
                Console.Write(n);
                Console.Write(m);
            }
        }
        static void Main(string[] args)
        {
            string linijaunosa = Console.ReadLine();
            string n = Convert.ToString(linijaunosa[0]);
            string m = Convert.ToString(linijaunosa[1]);
            linijaunosa = Console.ReadLine();
            string[] niz = linijaunosa.Split(' ');
            int n2 = Convert.ToInt32((niz[0]));
            int m2 = Convert.ToInt32((niz[1]));
            if (Math.Abs(m2 - n2)>1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                if (m2 == n2)
                {
                    ispis(n, n2, m, m2);
                }
                else if (m2 > n2)
                {
                    Console.Write(m);
                    ispis(n, n2, m, m2);
                }
                else
                {
                    Console.Write(n);
                    ispis(m, m2, n, n2);
                }

            }
            Console.ReadLine();
        }
    }
}