Mojtaba and Arpa are playing a game. They have a list of n numbers in the game.

In a player's turn, he chooses a number pk (where p is a prime number and k is a positive integer) such that pk divides at least one number in the list. For each number in the list divisible by pk, call it x, the player will delete x and add <image> to the list. The player who can not make a valid choice of p and k loses.

Mojtaba starts the game and the players alternatively make moves. Determine which one of players will be the winner if both players play optimally.

Input

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of elements in the list.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the elements of the list.

Output

If Mojtaba wins, print "Mojtaba", otherwise print "Arpa" (without quotes).

You can print each letter in any case (upper or lower).

Examples

Input

4
1 1 1 1


Output

Arpa


Input

4
1 1 17 17


Output

Mojtaba


Input

4
1 1 17 289


Output

Arpa


Input

5
1 2 3 4 5


Output

Arpa

Note

In the first sample test, Mojtaba can't move.

In the second sample test, Mojtaba chooses p = 17 and k = 1, then the list changes to [1, 1, 1, 1].

In the third sample test, if Mojtaba chooses p = 17 and k = 1, then Arpa chooses p = 17 and k = 1 and wins, if Mojtaba chooses p = 17 and k = 2, then Arpa chooses p = 17 and k = 1 and wins.
import java.io.*;
import java.util.*;

public class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine(), " :");
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    void solve() throws IOException {
        int n = readInt();

        HashMap<Integer, Integer> masks = new HashMap<>();
        for (int i = 0; i < n; i++) {
            int x = readInt();

            for (int j = 2; j * j <= x; j++) {
                if (x % j == 0) {
                    int cnt = 0;
                    while (x % j == 0) {
                        x /= j;
                        cnt++;
                    }

                    int prev = masks.getOrDefault(j, 0);
                    prev |= 1 << cnt;
                    masks.put(j, prev);
                }
            }
            if (x > 1) {
                masks.put(x, masks.getOrDefault(x, 0) | (1 << 1));
            }
        }
        int xor = 0;
        for (Map.Entry<Integer, Integer> e : masks.entrySet()) {
            xor = xor ^ grandi(e.getValue());
        }
        out.println(xor == 0 ? "Arpa" : "Mojtaba");
    }

    HashMap<Integer, Integer> grandiCache = new HashMap<>();

    int grandi(int mask) {
        if (mask % 2 == 1) mask--;
        if (mask == 0) return 0;
        if (grandiCache.containsKey(mask)) return grandiCache.get(mask);

        int last = -1;
        for (int i=1;i<=31;i++) {
            if (has(mask, i)) {
                last = i;
            }
        }
        TreeSet<Integer> set = new TreeSet<>();
        for (int remove = 1; remove <= last; remove++) {
            int next = mask;
            int removeMask = (1 << remove) - 1;
            next = next & removeMask;
            next = next | (mask >> remove);
            set.add(grandi(next));
        }
        for (int i = 0; ; i++) {
            if (!set.contains(i)) {
                grandiCache.put(mask, i);
                return i;
            }
        }
    }

    boolean has(int mask, int bit) {
        return (mask & (1 << bit)) != 0;
    }
}