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

public class CODEFORCES
{
	private InputStream is;
	private PrintWriter out;

	HashMap<Long, Integer> map = new HashMap<Long, Integer>();

	int check(long nm)
	{
		if (map.containsKey(nm))
			return map.get(nm);
		int mst = 0;
		long tmp = nm;
		while (tmp != 1)
		{
			mst++;
			tmp >>= 1;
		}
		int v = 0;
		long h = 1;
		HashSet<Integer> set = new HashSet<Integer>();
		for (int i = 1; i <= mst; i++)
		{
			tmp = ((h << i) - 1) & nm;
			tmp |= (nm >> i);
			set.add(check(tmp));
		}
		while (set.contains(v))
			v++;
		map.put(nm, v);
		return v;
	}

	void solve()
	{
		map.put((long) 1, 0);
		map.put((long) 0, 0);
		int n = ni();
		boolean v[][] = new boolean[2000][35];
		HashMap<Long, Integer> mp = new HashMap<Long, Integer>();
		int cnt = 0;
		long arr[] = new long[n];
		for (int i = 0; i < n; i++)
			arr[i] = ni();
		boolean u[] = new boolean[100000];
		ArrayList<Long> primes = new ArrayList<Long>();
		for (int i = 2; i < 100000; i++)
		{
			if (!u[i])
			{
				primes.add((long) i);
				for (long j = i * (long) i; j < 100000; j += i)
					u[(int) j] = true;
			}
		}
		int xor = 0;
		for (int i = 0; i < n; i++)
		{
			int c = 0;
			while (arr[i] != 1 && c < primes.size())
			{
				int op = 0;
				while (arr[i] % primes.get(c) == 0)
				{
					op++;
					arr[i] /= primes.get(c);
				}
				if (op > 0)
				{
					if (mp.containsKey(primes.get(c)))
						v[mp.get(primes.get(c))][op] = true;
					else
					{
						v[cnt][op] = true;
						mp.put(primes.get(c), cnt++);
					}
				}
				c++;
			}
			if (arr[i] != 1)
			{
				if (mp.containsKey(arr[i]))
					v[mp.get(arr[i])][1] = true;
				else
				{
					v[cnt][1] = true;
					mp.put(arr[i], cnt++);
				}
			}
		}
		for (int i = 0; i < cnt; i++)
		{
			long ans = 0;
			long h = 1;
			for (int j = 0; j < 35; j++)
				if (v[i][j])
					ans |= (h << j);
			xor ^= check(ans);
		}
		if (xor > 0)
			out.println("Mojtaba");
		else
			out.println("Arpa");
	}

	void soln() throws Exception
	{
		is = System.in;
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");
	}

	public static void main(String[] args) throws Exception
	{
		new CODEFORCES().soln();
	}

	// To Get Input
	// Some Buffer Methods
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf)
		{
			ptrbuf = 0;
			try
			{
				lenbuf = is.read(inbuf);
			} catch (IOException e)
			{
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
	{
		return !(c >= 33 && c <= 126);
	}

	private int skip()
	{
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	private double nd()
	{
		return Double.parseDouble(ns());
	}

	private char nc()
	{
		return (char) skip();
	}

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b)))
		{ // when nextLine, (isSpaceChar(b) && b != '
			// ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b)))
		{
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			} else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			} else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o)
	{
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}
}