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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	static int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		writer = new PrintWriter(System.out);
		banana();
		reader.close();
		writer.close();
	}

	static int N = 1000002;
	static int[] lp = new int[N + 1];
	static ArrayList<Integer> pr = new ArrayList<>();

	static void init() {
		for (int i = 2; i <= N; i++) {
			if (lp[i] == 0) {
				lp[i] = i;
				pr.add(i);
			}
			for (int j = 0; j < (int) pr.size() && pr.get(j) <= lp[i] && i * pr.get(j) <= N; j++) {
				lp[i * pr.get(j)] = pr.get(j);
			}
		}
	}

	static int mex(TreeSet<Integer> ts) {
		for (int i = 0;; ++i) {
			if (!ts.contains(i)) {
				return i;
			}
		}
	}

	static HashMap<Integer, Integer> mem = new HashMap<>();

	static int solveGame(TreeSet<Integer> game) {
		if (game.isEmpty() || game.last() == 0) {
			return 0;
		}

		int h = 0;
		for (int t : game) {
			h += (1 << t);
		}
		if (mem.containsKey(h)) {
			return mem.get(h);
		}

		TreeSet<Integer> next = new TreeSet<>();
		for (int x = 1; x <= game.last(); x++) {
			TreeSet<Integer> newGame = new TreeSet<>();
			for (int t : game) {
				if (t >= x) {
					newGame.add(t - x);
				} else {
					newGame.add(t);
				}
			}
			int sg = solveGame(newGame);
			next.add(sg);
		}

		int mx = mex(next);
		mem.put(h, mx);
		return mx;
	}

	static void banana() throws NumberFormatException, IOException {
		init();
		int n = nextInt();
		int[] a = new int[n];

		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
			int t = a[i];
			for (int p : pr) {
				while(t % p == 0) {
					t /= p;
				}
			}
			if (t > 1) {
				pr.add(t);
			}
		}

		int res = 0;

		for (int p : pr) {
			boolean have = false;
			for (int t : a) {
				if (t % p == 0) {
					have = true;
				}
			}
			if (have) {
				TreeSet<Integer> game = new TreeSet<>();
				for (int t : a) {
					int curr = 0;
					while (t % p == 0) {
						curr++;
						t /= p;
					}
					game.add(curr);
				}
				res ^= solveGame(game);
			}
		}

		writer.println(res == 0 ? "Arpa" : "Mojtaba");
	}
}