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

namespace _2021NMP
{
    class Program
    {
        static void Main(string[] args)
        {
            string ulaz1 = Console.ReadLine();
            string [] ulaz2 = Console.ReadLine().Split();
            int perin = int.Parse(ulaz2[0]);
            int petra = int.Parse(ulaz2[1]);
            int veci = 0;
            if (petra > perin)
                veci = 1;
            if (Math.Abs(perin - petra) < 2 || ulaz1[0] == ulaz1[1])
            {
                for (int i = 0; i < perin+petra; i++)
                {
                    if (i % 2 == 0 && veci == 0)
                        Console.Write(ulaz1[0]);
                    else if (i % 2 == 1 && veci == 0)
                        Console.Write(ulaz1[1]);
                    else if(i % 2 == 1 && veci == 1)
                        Console.Write(ulaz1[0]);
                    else if(i % 2 == 0 && veci == 1)
                        Console.Write(ulaz1[1]);
                }
                Console.WriteLine();
            }
            else Console.WriteLine("nemoguce");
        }
    }
}