using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;

class program
{
    static void Main()
    {
        string unos = Console.ReadLine();
        var s = Console.ReadLine().Split();
        int a = int.Parse(s[0]);
        int b = int.Parse(s[1]);
        char c = unos[0];
        char c2 = unos[1];
        StringBuilder sb = new StringBuilder();
        bool provera = true;
        if (a == b || a + 1 == b || a - 1 == b)
        {
            if (a == b)
            {
                for (int i = 0; i < a; i++)
                {
                    sb.Append(unos);
                }
            }
            else if (a > b)
            {
                for (int i = 0; i < b; i++)
                {
                    sb.Append(unos);
                }
                sb.Append(c);
            }
            else
            {
                sb.Append(c2);
                for (int i = 0; i < a; i++)
                {
                    sb.Append(unos);
                }
            }

        }
        else
        {
            Console.WriteLine("nemoguce");
            provera = false;
        }
        if (provera)
        {
            Console.WriteLine(sb.ToString());
        }


    }
}