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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] s1 = Console.ReadLine().ToCharArray();
            char c1 = s1[0];
            char c2 = s1[1];
            string[] s = Console.ReadLine().Split();
            int a1 = int.Parse(s[0]);
            int a2 = int.Parse(s[1]);
            string p = "";
            if (Math.Abs(a1 - a2) > 1)
                p = "nemoguce";
            else
            {
                if (a1 > a2)
                {
                    for (int i = 0; i < a2; i++)
                        p += c1 + "" + c2;
                    p += c2;
                }
                else if (a2 > a1)
                {
                    for (int i = 0; i < a1; i++)
                        p += c2 + "" + c1;
                    p += c2;
                }
                else
                    for (int i = 0; i < a2; i++)
                        p += c2 + "" + c1;
            }
            Console.WriteLine(p);
        }
    }
}