using System;

class Program {
    static void Main(string[] args) {
      
      string c,a,b;
      int pera,petra,razlika;
      string prvunos = Console.ReadLine();
      string[] unos = Console.ReadLine().Split(" ");
      a = prvunos[0];
      b = prvunos[1];
      pera = int.Parse(unos[0]);
      petra = int.Parse(unos[1]);
      razlika = pera-petra;
      if(razlika == 0){
       c = a + b;
       for(int i = 0;i<pera;i++){
         Console.Write(c);
        }
       }else if(pera == petra+1)
       {
         c = a+b;
         for(int i = 0;i<petra;i++){
            Console.Write(c);
         }
         Console.Write(a);
      }else if(pera+1 == petra){
        c = b+a;
        for(int i = 0;i<pera;i++){
         Console.Write(c);
        }
        Console.Write(b);
      }else{
        Console.Write("nemoguce");
      }
 }
}