import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        char a1,a2;
        String letterInput = scanner.nextLine();
        a1 = letterInput.charAt(0);
        a2 = letterInput.charAt(1);
        String output = "nemoguce";
        int c1,c2;
        String numberInput = scanner.nextLine();
        c1 = Integer.valueOf(Character.toString(numberInput.charAt(0)));
        c2 = Integer.valueOf(Character.toString(numberInput.charAt(2)));
        String tempString = "";
        if(c1 == c2 || c1 + 1 == c2 || c1 -1 == c2)
        {
            if(c1 == c2)
            {
                for(int i = 0 ; i < c1;i++)
                {
                    tempString += a1;
                    tempString += a2;
                }
            }
            else if(c1 +1 == c2)
            {
                tempString += a2;
                for(int i = 0 ; i < c1;i++)
                {
                    tempString += a1;
                    tempString += a2;
                }
            }
            else if(c1 -1 == c2)
            {
                tempString += a1;
                for(int i = 0 ; i < c2;i++)
                {
                    tempString += a2;
                    tempString += a1;
                }
            }
        }
        if(!tempString.equals(""))
        {
            output = tempString;
        }
        System.out.println(output);
    }
}