package zad1;

import java.util.Scanner;

public class Zad1 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String c12 = in.nextLine();
        char c1 = c12.charAt(0), c2 = c12.charAt(1);
        int a1 = in.nextInt(), a2 = in.nextInt();
        String rec = "", novaRec = "";
        for (int i = 0; i < a1; i++) {
            rec += c1;
        }
        for (int i = 0; i < a2; i++) {
            rec += c2;
        }
        char recSlova[] = rec.toCharArray();
        for (int i = 0; i < recSlova.length; i++) {
            int j = 1;
            while (j > 0 && j < recSlova.length - 1 && (recSlova[j + 1] == recSlova[j] || recSlova[j - 1] == recSlova[j])) {
                char t = recSlova[j];
                recSlova[j] = recSlova[j - 1];
                recSlova[j - 1] = t;
                j--;
            }
            if (recSlova[1] == recSlova[0]) {
                char t = recSlova[0];
                recSlova[0] = recSlova[recSlova.length - 1];
                recSlova[recSlova.length - 1] = t;
            }
        }
        int br = 0;
        for (int i = 0; i < recSlova.length; i++) {
            if (i > 0 && i < recSlova.length - 1 && (recSlova[i + 1] == recSlova[i] || recSlova[i - 1] == recSlova[i])) {
                br++;
            }
            if (recSlova[1] == recSlova[0]) {
                br++;
            }
        }
        for (int i = 0; i < recSlova.length; i++) {
            novaRec += recSlova[i];
        }
        if (br > 0) {
            System.out.println("nemoguce");
        } else {
            System.out.println(novaRec);
        }

    }

}