using System;

class Program {
  public static void Main (string[] args) {
    string s = Console.ReadLine();
    char c1 = s[0], c2 = s[1];
    string[] s1 = Console.ReadLine().Split();
    int a1 = Convert.ToInt32(s1[0]), a2 = Convert.ToInt32(s1[1]);

    if(Math.Max(a1, a2) > Math.Min(a1, a2) + 1)
    {
      Console.WriteLine("nemoguce");
    }
    else
    {
      if(a1 >= a2)
      {
        for(int i = 0;i < a1+a2; i++)
        {
          if(i % 2 == 0) Console.Write(c1);
          else Console.Write(c2);
        }
      }
      else
      {
        for(int i = 0;i < a1+a2; i++)
        {
          if(i % 2 == 0) Console.Write(c2);
          else Console.Write(c1);
        }
      }
    }
  }
}