using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nesusedna_slova
{
    class Program
    {
        static void Zameni(ref char a, ref char b)
        {
            char p = a;
            a = b;
            b = p;
        }
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char c1 = s[0];
            char c2 = s[1];
            string[] h = Console.ReadLine().Split();
            int a1 = int.Parse(h[0]);
            int a2 = int.Parse(h[1]);

            string k = "";
            int min = Math.Min(a1, a2);
            int max = Math.Max(a1, a2);
            if (max<=min+1 && c1!=c2)
            {
                char c = c1;
                for (int i = 0; i < a1+a2; i++)
                {

                    k += (char)c;
                    Zameni(ref c, ref c2);

                }
                Console.WriteLine(k);
            }
            else
            {
                Console.WriteLine("nemoguce");
            }
        }
    }
}