using System;

namespace Takmicenje
{
    class Program
    {
        static string resenje(int a, int b, char _a, char _b)
        {
            char[] resenje = new char[a + b];
            if (a - b > 1 || b - a > 1)
                return "nemoguce";
            char temp = _a;
            if (a  <= b)
            {
                _a = _b;
                _b = temp;
            }
            for (int i = 0; i < a + b; i++)
            {
                resenje[i] = i % 2 == 0 ? _a : _b;
            }
            return new string(resenje);
        }
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            char[] charArr = input.ToCharArray();
            char _a = charArr[0];
            char _b = charArr[1];
            string[] input_ = Console.ReadLine().Split();
            int a = int.Parse(input_[0]);
            int b = int.Parse(input_[1]);

            Console.WriteLine(resenje(a, b, _a, _b));
        }
    }
}