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]);
            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
            {
                char[] c0 = new char[] {c1,c2 , c1 ,c2 , c1 , c2 , c1 , c2 , c1 , c2 ,
c1, c2, c1, c2, c1, c2, c1, c2, c1, c2,
c1, c2, c1, c2, c1, c2, c1, c2, c1, c2,
c1, c2, c1, c2, c1, c2, c1, c2, c1, c2,
c1, c2, c1, c2, c1, c2, c1, c2, c1, c2 };
                StringBuilder s0 = new StringBuilder();
                s0.Append(c0);
                while (s0.Length < a4)
                {
                    s0.Append(s0);
                }
                Console.WriteLine(s0.Remove(a4,s0.Length-a4));
            }
        }
    }
}