#include <stdio.h>
#include <string.h>
int main(void)
{

  char str[100], tmp, str1[100];
  int i, len, pol, x, y, p = 0, k = 0, t = 0, max = 0;	
	
  gets(str);
  
  strcpy (str1, str);
  
  scanf("%d%d", &x, &y);
  
	
  len = strlen(str);
  pol = len/2;
  
  for (i = 0; i < pol; i++) {
    tmp = str[len - 1 - i];
    str[len - 1 - i] = str[i];
    str[i] = tmp;
  }
  
  if(y>x) max = y;
  	else max = x;

if(x > y || x==y ){

if(x == y){

while(p<max){
  		printf("%s", str1);
  		p++;
	  }
}	else if(x + 1 == y || y+1 == x){
	
	while(p<max){
		if(p == max-1){
			printf("%c", str1[0]);
		}
  		else printf("%s", str1);
  		p++;
  		
	
}}	else printf("Nemoguce");
}
if(x < y || x==y ){

if(x == y){

while(p<max){
  		printf("%s", str);
  		p++;
	  }
}	else if(x + 1 == y || y+1 == x){
	
	while(p<max){
		if(p == max-1){
			printf("%c", str[0]);
		}
  		else printf("%s", str);
  		p++;
  		
	
}}	else printf("nemoguce");
}
  return 0;
}