using System;

namespace ConsoleApp17
{
   
    class Program
    {
        static public void Main()
        {
            char c1 = (char)Console.Read();
            char c2 = (char)Console.Read();
            Console.ReadLine();
            string[] split = Console.ReadLine().Split();
            int a1 = int.Parse(split[0]);
            int a2 = int.Parse(split[1]);
            string resenje =  "";
            if (a1==a2&&c1!=c2)
            {
                for (int i = 0; i < a1; i++)
                {
                    
                        resenje += c2;
                        resenje += c1;
                   
                   
                    
                }
                Console.WriteLine(resenje);
            }
            else
            {
                Console.WriteLine("nemoguce");
            }
        }
    }
}