using System;

class Program
{
    static void Main(string[] args)
    {
        string s = Console.ReadLine();
        string[] red = Console.ReadLine().Split();
        int n1 = int.Parse(red[0]);
        int n2 = int.Parse(red[1]);
        if (Math.Abs(n1 - n2) > 1) Console.WriteLine("nemoguce");
        else
        {
            if (n1 < n2) Console.Write(s[1]);
            for (int i = 0; i < Math.Min(n1, n2); i++)
                Console.Write(s);
            if (n2 > n1) Console.Write(s[0]);
        }
    }
}