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 < a2; i++)
        {
          Console.Write(c1);
          Console.Write(c2);
        }
        if(a1 > a2) Console.Write(c1);
      }
      else
      {
        for(int i = 0;i < a1; i++)
        {
          Console.Write(c2);
          Console.Write(c1);
        }
        Console.Write(c2);
      }
    }
  }
}