using System;

public class Program
{

    public static void Main()
    {
        int i;
        char[] dvoslova=Console.ReadLine(). ToArray();
        char c1=dvoslova[0];
        char c2=dvoslova[1];
        int a1=int.Parse(Console.ReadLine());
        int a2=int.Parse(Console.ReadLine());
        char resenje[a1+a2-1];
        if(Math.Abs(a1-a2)<=1)
        {
            if(a1>a2)
            {
                resenje[0]=c1;
                for(i=1;i<a1+a2;i=i+2)
                {
                    resenje[i]=c2;
                    resenje[i+1]=c1;
                 }
             }
             else if(a2<a1)
            {
                resenje[0]=c2;
                for(i=0;i<a2+a1;i=i+2)
                 {
                     resenje[i]=c1;
                     resenje[i+1]=c2;
                 }
             }
             else
            {
                for(i=0;i<a2+a1;i=i+2)
                 {
                     resenje[i]=c1;
                     resenje[i+1]=c2;
                 }
            
            }     
            for(i=0;i<a2+a1;i++)
            Console.Write(resenje[i]);



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