using System;

public class MyProgram
{
    public static void Main(string[] args)
    {
        string c1c2;
        string a1a2;
        string c1;
        string c2;
        int a1;
        int a2;
        
        c1c2 = Console.ReadLine();
        a1a2 = Console.ReadLine();   
        c1=left(c1c2,1);
        c2=right(c1c2,1);
        a1 = Convert.ToInt32(left(a1a2,1));
        a2 = Convert.ToInnt32(right(a1a2,1));
        if (a1 > a2)
        {
            if (a1 - a2 > 1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                Console.Write(c1);
                while (a2 > 0)
                {
                    a2 = a2 - 1;
                    Console.Write(c2 + c1);
                }
            }
        }
        else
        {
            if (a2 - a1 > 1)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                if (a1 == a2)
                {
                }
                else
                {
                    Console.Write(c2);
                }
                while (a1 > 0)
                {
                    a1 = a1 - 1;
                    Console.Write(c1 + c2);
                }
            }
        }
    }
    
    // .NET can only read single characters or entire lines from the console.
    // The following function safely reads a double value.
    private static double readValue()
    {
        double result;
        while (!double.TryParse(Console.ReadLine(), out result));
        return result;
    }
}