using System;
using System.Linq;

namespace takmicenje002
{
    class Program
    {
        

        static void Main(string[] args)
        {
            string c1c2 = Console.ReadLine();
            string c1 = c1c2.Substring(0,1);
            string c2 = c1c2.Substring(1);
            string[] a1a2 = Console.ReadLine().Split(' ');
            int a1 = int.Parse(a1a2[0]); 
            int a2 = int.Parse(a1a2[1]);
            if (a1 - a2==0) Console.WriteLine(String.Concat(Enumerable.Repeat(c1c2, a1)));
            else if(Math.Abs(a1-a2)==1) {
                if(a1>a2) Console.WriteLine(String.Concat(Enumerable.Repeat(c1c2, a1-a2))+c1);
                else if (a2 > a1) Console.WriteLine(c2+String.Concat(Enumerable.Repeat(c1c2, a2-a1)));}
            else Console.WriteLine("nemoguce");
            
        }
    }
}