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.*;
import java.math.BigInteger;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class E extends PrintWriter {

    void add(int p, int e, Map<Integer, Integer> vals) {
        if (p == 1 || e == 0) {
            return;
        }
        Integer key = p;
        Integer cur = vals.get(key);
        int val = 0;
        if (cur != null) {
            val = cur;
        }
        val |= (1 << e);
        vals.put(key, val);
    }

    int solve(final int x, Map<Integer, Integer> dp) {
        if (x <= 1) {
            return 0;
        }

        Integer key = x;

        Integer ans = dp.get(key);
        if (ans != null) {
            return ans;
        }

        int n = 0, m = 42;
        int[] f = new int[m];

        f[n++] = -1;
        f[n++] = m;

        for (int i = 1; i < 32; i++) {

            int r = (1 << i) - 1;
            int l = ~r;

            // int y = (l & (x >>> 1)) | (r & (x));

            int y = (x >> i) | (x & ((1 << i) - 1));

            if (y < x) {
                f[n++] = solve(y, dp);
            }
        }

        Arrays.sort(f, 0, n);

        // println(Arrays.toString(Arrays.copyOf(f, n)));

        for (int i = 1; i < n; i++) {
            int l = f[i - 1] + 1;
            int r = f[i];
            if (l < r) {
                dp.put(key, l);
                return l;
            }
        }

        return m;
    }

    void run() {
        int n = nextInt();

        Map<Integer, Integer> vals = new HashMap<>();

        for (int i = 0; i < n; i++) {
            int x = nextInt();

            for (int p = 2; p * p <= x; p++) {
                int e = 0;

                while (x % p == 0) {
                    x /= p;
                    ++e;
                }

                add(p, e, vals);

            }
            add(x, 1, vals);
        }

        int xor = 0;

        Map<Integer, Integer> dp = new HashMap<>();

        // println(vals);

        for (int val : vals.values()) {
            xor ^= solve(val, dp);
        }

        if (xor == 0) {
            println("Arpa");
        } else {
            println("Mojtaba");
        }

    }

    boolean skip() {
        while (hasNext()) {
            next();
        }
        return true;
    }

    int[][] nextMatrix(int n, int m) {
        int[][] matrix = new int[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                matrix[i][j] = nextInt();
        return matrix;
    }

    String next() {
        while (!tokenizer.hasMoreTokens())
            tokenizer = new StringTokenizer(nextLine());
        return tokenizer.nextToken();
    }

    boolean hasNext() {
        while (!tokenizer.hasMoreTokens()) {
            String line = nextLine();
            if (line == null) {
                return false;
            }
            tokenizer = new StringTokenizer(line);
        }
        return true;
    }

    int[] nextArray(int n) {
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = nextInt();
        }
        return array;
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException err) {
            return null;
        }
    }

    public E(OutputStream outputStream) {
        super(outputStream);
    }

    static BufferedReader reader;
    static StringTokenizer tokenizer = new StringTokenizer("");
    static Random rnd = new Random();
    static boolean OJ;

    public static void main(String[] args) throws IOException {
        OJ = System.getProperty("ONLINE_JUDGE") != null;
        E solution = new E(System.out);
        if (OJ) {
            reader = new BufferedReader(new InputStreamReader(System.in));
            solution.run();
        } else {
            reader = new BufferedReader(new FileReader(new File(E.class.getName() + ".txt")));
            long timeout = System.currentTimeMillis();
            while (solution.hasNext()) {
                solution.run();
                solution.println();
                solution.println("----------------------------------");
            }
            solution.println("time: " + (System.currentTimeMillis() - timeout));
        }
        solution.close();
        reader.close();
    }
}