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

namespace zad_1
{
    class Program
    {
        static void Main(string[] args)
        {
            string ulaz;
            int a, b;
            ulaz = Console.ReadLine();
            string[] s1 = Console.ReadLine().Split();
            a = int.Parse(s1[0]);
            b = int.Parse(s1[1]);
            if (((a - b) > 1) || ((a - b) < -1)) { Console.WriteLine("nemoguce"); }
            else
            {
                if (a == b)
                {
                    for (int i = 0; i < a; i++)
                    {
                        Console.Write(ulaz);
                    }
                }
                else if (a > b)
                {
                    for (int i = 0; i < b; i++)
                    {
                        Console.Write(ulaz);
                    }
                    Console.Write(ulaz[0]);
                }
                else
                {
                    Console.Write(ulaz[1]);
                    for (int i = 0; i < a; i++)
                    {
                        Console.Write(ulaz);
                    }
                    
                }
            }
        }
    }
}