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

namespace Zadatak1
{
    class Program
    {
        static void Main(string[] args)
        {
            string c = Console.ReadLine();
            char c1 = c[0];
            char c2 = c[1];
            string[] s = Console.ReadLine().Split();
            int a1 = int.Parse(s[0]);
            int a2 = int.Parse(s[1]);
            if ((Math.Abs(a2 - a1) > 1) || c1 == c2)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                if (a1 >= a2)
                {
                    while (a1 != 0 || a2 != 0)
                    {
                        if (a1 > 0)
                        {
                            Console.Write(c1);
                            a1--;
                        }
                        if (a2 > 0)
                        {
                            Console.Write(c2);
                            a2--;
                        }
                    }
                }
                else
                {
                    while (a1 != 0 || a2 != 0)
                    {
                        if (a2 > 0)
                        {
                            Console.Write(c2);
                            a2--;
                        }
                        if (a1 > 0)
                        {
                            Console.Write(c1);
                            a1--;
                        }
                    }
                    
                }
                Console.WriteLine();
            }
        }
    }
}