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

namespace a
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char c1 = (char)s[0];
            char c2 = (char)s[1];
            string[] s1 = Console.ReadLine().Split();
            int a1 = int.Parse(s1[0]);
            int a2 = int.Parse(s1[1]);
            var watch = System.Diagnostics.Stopwatch.StartNew();
            int a4 = a1 + a2;
            if (a1 < a2)
            {
                int a3 = a1;
                a1 = a2;
                a2 = a3;
                char c3 = c1;
                c1 = c2;
                c2 = c3;
            }
            if (a1 - a2 > 1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                string s3 = ""; 
                string s2 = c1.ToString() + c2.ToString();
                for (int i = 0; i < a4; i++)
                {
                    if (i % 2 == 0)
                    {
                        s3 = s3 + c1.ToString();
                    }
                    else
                    {
                        s3 = s3 + c2.ToString();
                    }
                }
                /*if (a4 % 2 == 0)
                {
                    Console.WriteLine(s3);
                }
                else
                {
                    Console.WriteLine(s3 + c1.ToString());
                }
                /*string s2 = c1.ToString() + c2.ToString();
                bool b1 = true;
                while(b1)
                {

                }*/
            }

            watch.Stop();
            Console.WriteLine(watch.ElapsedMilliseconds);
        }
    }
}