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]);
            int prop = Mathf.Abs(a1 - a2) ;
            if(prop < 2)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                string ot = "";
                bool switcher = false;
                for (int i = 0; i < a1+a2; i++)
                {
                    if (switcher)
                        ot += c1;
                    else
                        ot += c2;
                    switcher = !switcher;
                }
                Console.WriteLine(ot);
            }
        }
    }
}