import java.util.Scanner;

public class TakmicenjePrvi {

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