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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] s3 = Console.ReadLine().Split();
            int x = Convert.ToInt32(s3[0]);
            int y = Convert.ToInt32(s3[1]);
            StringBuilder sb = new StringBuilder("", 100000);
            if (x > y + 1|| y > x + 1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                if (x > y)
                {
                    for (int i = 0; i < y; i++)
                    {
                        sb.Append(s[0]);
                        sb.Append(s[1]);
                    }
                    sb.Append(s[0]);
                }
                else
                {
                    for (int i = 0; i < x; i++)
                    {
                        sb.Append(s[1]);
                        sb.Append(s[0]);
                    }
                }
                if(y>x) sb.Append(s[1]);
            }
            Console.WriteLine(sb);
        }
    }
}