using System;

class Program {
  public static void Main (string[] args) {
    string c1c2=Console.ReadLine();
    string[]s1=Console.ReadLine().Split();
    int a1=int.Parse(s1[0]);
    int a2=int.Parse(s1[1]);
    if(Math.Abs(a1-a2)>1){
      Console.WriteLine("nemoguce");
    }
    else{
      string[]rec=Ispis(c1c2,a1,a2);
    }
    for(int i=0;i<a1+a2;i++){
      Console.Write({0},rec[i]);
    }
    
  }
  static string[]Ispis(string c1c2,int a1,int a2){
    int b=0;
    string[]rec=new string[a1+a2];
    if(a10>=a2){
      while(b<a2){
        rec[b]=c1;
        rec[b+1]=c2;
        b+=2;
      }
      if(a1>a2){
        rec[b]=c1;
      }
    }
    else{
      while(b<a1){
        rec[b]=c2;
        rec[b+1]=c1;
        b+=2;
      }
      rec[b]=c2;
    }
    return rec;
  }
}