using System;
using System.Collections.Generic;
using System.Linq;

class cppboljiodcs
{
    
    static void Main()
    {
        string s = Console.ReadLine();
        char c1 = s[0];
        char c2 = s[1];
        string[] s2 = Console.ReadLine().Split();
        int a1 = int.Parse(s2[0]);
        int a2 = int.Parse(s2[1]);

        if (Math.Abs(a1 - a2) > 1)
            Console.WriteLine("nemoguce");
        else
            if(a1>a2)
        {
            for (int i = 0; i < a1 + a2; i++)
            {
                if (i % 2 == 0)
                    Console.Write(c1);
                else
                    Console.Write(c2);
            }
        }
            else
        {
            for (int i = 0; i < a1 + a2; i++)
            {
                if (i % 2 == 0)
                    Console.Write(c2);
                else
                    Console.Write(c1);
            }
        }
            

    }
}