using System;

class Program
{
    static bool Negativan(int x) { return x < 0; }

    static void Main(string[] args)
    {
        string s = Console.ReadLine();
        char c1 = s[0];
        char c2 = s[1];
        var jeajea = Console.ReadLine().Split();
        double a1 = double.Parse(jeajea[0]);
        double a2 = double.Parse(jeajea[1]);
        if(Math.Abs(a1-a2)>1)
        {
            Console.WriteLine("nemoguce");
        }
        else if(a1>a2)
        {
            for(int i=0;i<(a1+a2-1)/2;i++)
            {
                Console.Write(c1);
                Console.Write(c2);
            }
            Console.WriteLine(c1);
        }
        else if(a2>a1)
        {
            for (int i = 0; i < (a1 + a2 - 1)/2; i++)
            {
                Console.Write(c2);
                Console.Write(c1);
            }
            Console.WriteLine(c2);
        }
        else
        {
            for (int i = 0; i < (a1 + a2)/2; i++)
            {
                Console.Write(c1);
                Console.Write(c2);
            }
            Console.WriteLine();
        }
    }
}