#include <stdio.h>
#include <stdlib.h>
int main()
{
  char c1,c2,temp1,temp2;
  int a1,a2,i;
  scanf("%c%c",&c1,&c2);
  scanf("%d %d",&a1,&a2);
  if(c1 == c2)
  {
      printf("nemoguce");
      return 0;
  }
  if(abs(a1-a2) > 1)
  {
      printf("nemoguce");
      return 0;
  }
  if(a1 >= 1000 || a2 >= 1000)
  {
      printf("nemoguce");
      return 0;
  }
  if(a1 <= 1 || a2 <= 1)
  {
      printf("nemoguce");
      return 0;
  }
  char string[a1 + a2 + 1];
  for(i=0; i<a1+a2; i++){
    if(a1>=a2){
    temp1 = c1;
    temp2 = c2;
    }
    if(a2>a1){
    temp1 = c2;
    temp2 = c1;
    }
    if(i%2==0){
        string[i] = temp1;
    }
    else{
        string[i] = temp2;
    }
  }
  for(i = 0; i < a1+a2; i++)
  {
      printf("%c",string[i]);
  }
  return 0;
}