using System;

namespace nesusedni
{
    class Program
    {
        static void Main(string[] args)
        {
            char a, b;
            string u;
             u = Console.ReadLine();
            char[] n = u.ToCharArray();
            a = n[0];
            b = n[1];
            u = Console.ReadLine();
            string[] sr = u.Split(); 
            int x = int.Parse(sr[0]);
            int y = int.Parse(sr[1]);
            char[] d = new char[x + y];
           
            
            if(Math.Abs(x-y)>1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                if(x>y)
                {
                    for(int i=0;i<x+y;i++)
                    {
                        if (i % 2 == 0) { d[i] = a; }
                        else { d[i] = b; }
                    }
                }
                else
                {
                    for (int i = 0; i < x + y; i++)
                    {
                        if (i % 2 == 0) { d[i] = b; }
                        else { d[i] = a; }
                    }
                }
            }
           
            for (int i = 0; i < x + y; i++)
            {
                Console.Write(d[i]);
            }
           
        }
    }
}