package nesusedni;

import java.util.Scanner;


public class Nesusedni {

   
    public static void main(String[] args) {
     String c,s="";
     char c1,c2;
     int a1,a2,i;
     Scanner in=new Scanner(System.in);
     c=in.nextLine();
     a1=in.nextInt();
     a2=in.nextInt();
     c1=c.charAt(0);
     c2=c.charAt(1);
 
     if(a1+1==a2 || a2+1==a1){
         if(a1>a2 ){
             for(i=0;i<a1+a2;i++){
                 if(i%2==1){
                     s=s+c1;
                 }
                 else{
                     s=s+c2;
                 }
             }
             System.out.println(s);
         }
         else{
             for(i=0;i<a1+a2;i++){
                 if(i%2==1){
                     s=s+c2;
                 }
                 else{
                     s=s+c1;
                 }
             }
             System.out.println(s);
         }
     }
     else if(a1==a2){
             for(i=0;i<a1+a2;i++){
                 if(i%2==1){
                     s=s+c1;
                 }
                 else{
                     s=s+c2;
                 }
             }
             System.out.println(s);
     }
     else{
         System.out.println("nemoguce");
     }
    }
    
}