import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        String s="",k;
        char c1,c2;
        long a1,a2;
        Scanner sc=new Scanner(System.in);
        k=sc.next();
        c1=k.charAt(0);
        c2=k.charAt(1);
        a1=sc.nextLong();
        a2=sc.nextLong();
        if(a1>a2+1||a2>a1+1){
            System.out.println("nemoguce");
            System.exit(1);
        }
        for(int i=0;i<a1+a2;i++){
            String s1=s;
            if(i%2==0){
                s=s1+c2;
            }
            else{
                s=s1+c1;
            }
        }
        System.out.println(s);
    }
}