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

namespace ConsoleApplication128
{
    class Program
    {
        static string niz(int a1, int a2, char[] c)
        {
            string s = "";
            if (a1 > a2)
            {
                for (int i = 0; i < a2; i++)
                {
                    s += c[0] + c[1];
                }
                s += c[0];
                return s;
            }
            for (int i = 0; i < a1; i++)
            {
                s += c[0] + c[1];
            }
            s += c[1];
            return s;
        }
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char[] c = new char[2];
            int i = 0;
            foreach(char k in s)
            {
                c[i] = k;
            }
            string[] str = Console.ReadLine().Split();
            int a1 = int.Parse(str[0]);
            int a2 = int.Parse(str[1]);
            int r = Math.Abs(a1 - a2);
            if (r >= 2)
            {
                Console.WriteLine("nemoguce");
            }
            else
            {
                Console.WriteLine(s);
            }
        }
    }
}