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 C {

	void submit() {
		int n = nextInt();
		HashMap<Integer, Integer> map = new HashMap<>();
		while (n-- > 0) {
			int x = nextInt();
			
			for (int i = 2; i * i <= x; i++) {
				if (x % i == 0) {
					int key = i;
					int val = 0;
					while (x % i == 0) {
						x /= i;
						val++;
					}
					Integer prev = map.get(key);
					if (prev == null) {
						prev = 0;
					}
					map.put(key, prev | (1 << (val - 1)));
				}
			}
			
			if (x != 1) {
				Integer prev = map.get(x);
				if (prev == null) {
					prev = 0;
				}
				map.put(x, prev | 1);
			}
			
		}
		
		int xor = 0;
		for (int mask : map.values()) {
			
//			System.err.println(mask);
			xor ^= dfs(mask);
		}
		
		out.println(xor == 0 ? "Arpa" : "Mojtaba");
	}

	void preCalc() {

	}

	void stress() {

	}

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

	int dfs(int mask) {
		if (memo.containsKey(mask)) {
			return memo.get(mask);
		}

		long bs = 0;

		for (int move = 0;; move++) {

			int low = mask & ((1 << move) - 1);
			int high = mask >> move;

			if (high == 0) {
				break;
			}

			int to = low | (high >> 1);
			int val = dfs(to);
			if (val >= 63) {
				throw new AssertionError();
			}
			bs |= 1L << val;
		}
		
		int ret = Long.numberOfTrailingZeros(bs + 1);
		memo.put(mask, ret);
		return ret;
	}

	void testGrundy() {
		int N = 5;
		int[] gr = new int[1 << N];

		for (int mask = 1; mask < (1 << N); mask++) {

			HashSet<Integer> can = new HashSet<>();

			for (int move = 0; move < N; move++) {

				int low = mask & ((1 << move) - 1);
				int high = mask >> move;

				if (high == 0) {
					continue;
				}

				int to = low | (high >> 1);

				// System.err.println(toStr(mask) + " -> " + toStr(to));

				can.add(gr[to]);
			}

			while (can.contains(gr[mask])) {
				gr[mask]++;
			}

			System.err.println(toStr(mask) + ": " + gr[mask]);
		}

	}

	void testDfs() {
		// HashSet<Integer> vis = new HashSet<>();
		// dfs(rand(100_000_000, 1_000_000_000), vis);
		// System.err.println(vis.size());
	}

	String toStr(int mask) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < 20; i++) {
			if (test(mask, i)) {
				sb.append(i + 1);
				sb.append(" ");
			}
		}
		if (sb.length() == 0) {
			return "empty";
		}
		return sb.toString();
	}

	static final boolean test(int mask, int i) {
		return ((mask >> i) & 1) == 1;
	}

	C() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		// stress();
		// testGrundy();
		// for (int i = 0; i >= 0; i++) {
		// testDfs();
		// }
		out.close();
	}

	static final Random rng = new Random();

	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}

	public static void main(String[] args) throws IOException {
		new C();
	}

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;

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

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

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