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

	static HashMap<Integer, Integer> memo = new HashMap<>();
	
	public static void main(String[] args) throws IOException {
		IO io = new IO(System.in);

		int n = io.nextInt();
		int[] a = new int[n];
		
		HashMap<Integer, Integer> map = new HashMap<>();

		for (int i = 0; i < n; i++) {
			a[i] = io.nextInt();
			
			for (int j = 2; j*j <= a[i]; j++) {
				int pow = 0;
				while (a[i] % j == 0) {
					a[i] /= j;
					pow++;
				}
				if (pow==0) continue;
				if (!map.containsKey(j)) {
					map.put(j, (1<<(pow-1)));
				} else {
					map.put(j, map.get(j) | (1<<(pow-1)));
				}
			}
			if (a[i] > 1) {
				if (!map.containsKey(a[i])) {
					map.put(a[i], 1);
				} else {
					map.put(a[i], map.get(a[i]) | 1);
				}
			}
		}
		
//		for (int i = 0; i < n; i++) {
//			a[i] = io.nextInt();
//			
//			HashMap<Integer, Integer> decomp = primeFactors(a[i]);
//			for (int l : decomp.keySet()) {
//				int pow = decomp.get(l);
//				if (!map.containsKey(l)) {
//					map.put(l, 1 << (pow-1));
//				} else {
//					map.put(l, map.get(l) | 1 << (pow-1));
//				}
//			}
//		}
		
		int res = 0;
		
		for (int l : map.keySet()) {
			res = res ^ dp(map.get(l));
		}
		
		if (res != 0) {
			io.println("Mojtaba");
		} else {
			io.println("Arpa");
		}

		io.close();
	}
	
	static int dp(int mask) {
		if (mask==0) return 0;
		if (memo.containsKey(mask)) return memo.get(mask);
		
		// Return grundy number of this mask: mex of reachable masks
		TreeSet<Integer> reach = new TreeSet<>();
		
		int max_bit = Integer.toBinaryString(mask).length();
		
		for (int i = 1; i <= max_bit; i++) {
			// divide numbers by p^i
			String cur = Integer.toBinaryString(mask);
			String next = Integer.toBinaryString((mask >> i) | (mask & (1<<(i-1))-1));
			reach.add(dp((mask >> i) | (mask & (1<<(i-1))-1)));
		}
		
		int res = mex(reach);
		memo.put(mask, res);
		return res;
	}
	
	static int mex(TreeSet<Integer> set) {
		for (int i = 0; i < set.size(); i++) {
			if (!set.contains(i)) return i;
		}
		return set.size();
	}

	static int max_deg(int a, int p) {
		int res = 0;
		while (a % p == 0) {
			a = a / p;
			res++;
		}
		return res;
	}
	
	static HashMap<Integer, Integer> primeFactors(int a) {
		HashMap<Integer, Integer> res = new HashMap<Integer, Integer>();
		while (a % 2 == 0) {
			res.put(2, res.get(2) == null ? 1 : res.get(2) + 1);
			a = a / 2;
		}
		// Careful! Loop variable is a long
		for (int i = 3; i * i <= a; i = i + 2) {
			while (a % i == 0) {
				res.put(i, res.get(i) == null ? 1 : res.get(i) + 1);
				a = a / i;
			}
		}
		if (a > 2) {
			res.put(a, res.get(a) == null ? 1 : res.get(a) + 1);
		}
		return res;
	}

	static class IO extends PrintWriter {
		static BufferedReader r;
		static StringTokenizer t;

		public IO(InputStream i) {
			super(new BufferedOutputStream(System.out));
			r = new BufferedReader(new InputStreamReader(i));
			t = new StringTokenizer("");
		}

		public String next() throws IOException {
			while (!t.hasMoreTokens()) {
				t = new StringTokenizer(r.readLine());
			}
			return t.nextToken();
		}

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

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

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