package nesusedni;

import java.util.Scanner;

public class Nesusedni {

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

}
}