using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            String[] p = Console.ReadLine().Split();
            int a = int.Parse(p[0]);
            int b = int.Parse(p[1]);
            if (Math.Abs(a - b) > 1)
                Console.WriteLine("nemoguce");
            else if (a > b)
            {
                Console.Write(s[0]);
                for (int i = 0; i < b; i++)
                    Console.Write(s[1] + "" + s[0]);
            }
            else if (b > a)
            {
                Console.Write(s[1]);
                for (int i = 0; i < a; i++)
                    Console.Write(s[0] + "" + s[1]);
            }
            else
            {
                for (int i = 0; i < a; i++)
                    Console.Write(s[1] + "" + s[0]);
            }
        }
    }
}