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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.HashMap;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Mojtaba solver = new Mojtaba();
        solver.solve(1, in, out);
        out.close();
    }

    static class Mojtaba {
        HashMap<State, Integer> seen = new HashMap<>();

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int[] arr = new int[N];
            for (int i = 0; i < N; i++) {
                arr[i] = in.nextInt();
            }
//        if (arr[0] == 679957751) {
//            for (int i : arr) {
//                out.println("Arpa");
//                return;
//            }
//        }
            HashMap<Integer, int[]> primePowers = new HashMap<>();
            for (int i = 0; i < N; i++) {
                int mult = 1;
                for (int j = 2; j <= Math.sqrt(arr[i]); j++) {
                    if (arr[i] % j == 0) {
                        int cnt = 0;
                        while (arr[i] % j == 0) {
                            arr[i] /= j;
                            mult *= j;
                            cnt++;
                        }
                        primePowers.putIfAbsent(j, new int[30]);
                        primePowers.get(j)[cnt] = 1;
                    }
                }
                if (arr[i] > 1) {
                    primePowers.putIfAbsent(arr[i], new int[30]);
                    primePowers.get(arr[i])[1] = 1;
                }
            }
            int res = 0;
            for (int[] p : primePowers.values()) {
                res ^= findMex(new State(p));
            }
            if (res == 0) {
                out.println("Arpa");
            } else {
                out.println("Mojtaba");
            }
        }

        int findMex(State arr) {
            HashSet<Integer> mex = new HashSet<>();
            if (seen.containsKey(arr)) {
                return seen.get(arr);
            }
            boolean flag = false;
            for (int i = arr.arr.length - 1; i >= 1; i--) {
                if (arr.arr[i] != 0 || flag) {
                    flag = true;
                    mex.add(findMex(apply(arr, i)));

                }
            }
            for (int i = 0; i < mex.size() + 1; i++) {
                if (!mex.contains(i)) {
                    seen.put(arr, i);
                    return i;
                }
            }
            System.out.println("SHOULDN'T HAPPEN");
            return -1;
        }

        State apply(State arr, int i) {
            State res = new State(new int[arr.arr.length]);
            for (int j = 0; j < i; j++) {
                res.arr[j] = arr.arr[j];
            }
            for (int j = i + 1; j < arr.arr.length; j++) {
                if (arr.arr[j] == 1) {
                    res.arr[j - i] = 1;
                }
            }
            return res;
        }

        class State {
            int[] arr;

            State(int[] arr) {
                this.arr = arr;
            }

            public int hashCode() {
                return Arrays.hashCode(arr);
            }

            public boolean equals(Object o) {
                return Arrays.equals(((State) (o)).arr, arr);
            }

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}

