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

namespace Nesusedni {
    internal class Program {
        static void Main(string[] args) {

            string letters = Console.ReadLine();
            string[] numbers = Console.ReadLine().Split(' ');

            string c1 = letters[0].ToString();
            string c2 = letters[1].ToString();
            int a1 = int.Parse(numbers[0]);
            int a2 = int.Parse(numbers[1]);
            int sum = a1 + a2;

            string res = "";

            while (a1 > 0 && a2 > 0) {

                res += c1 + c2;

                a1--;
                a2--;

            }

            if (res.Length < sum) {
                Console.WriteLine("nemoguce");
            }
            else {
                Console.WriteLine(res);
            }

        }
    }
}