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.
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 100;
const long long mod = 1e9 + 7;
const long long inf = 2 * 1e18;
const int delta = 11057;
long long pw(long long a, long long b, long long c = mod) {
  if (b == 0) return 1;
  long long ans = pw(a, b / 2, c);
  ans = (ans * ans) % c;
  if (b & 1) ans = (ans * a) % c;
  return ans;
}
int n, m, k, a[101], sieve[maxn];
map<int, map<int, int>> fact;
set<int> pr;
map<int, pair<int, bool>> dp;
int solve(int mask) {
  if (mask == 1) return 0;
  auto x = dp[mask];
  if (x.second == 1) return x.first;
  bool mark[maxn];
  fill(mark, mark + 800, false);
  for (int k = 1; k <= log2(mask); k++) {
    mark[solve((mask >> k) | (mask & ((1 << k) - 1)))] = 1;
  }
  for (int i = 0; i < maxn; i++) {
    if (mark[i] != true) {
      dp[mask] = {i, 1};
      return i;
    }
  }
}
void load_sieve() {
  for (int i = 1; i < maxn; i++) sieve[i] = i;
  for (int i = 2; i * i < maxn; i++) {
    if (sieve[i] != i) continue;
    for (int j = i * i; j < maxn; j += i) {
      sieve[j] = min(sieve[j], i);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  load_sieve();
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    long long s = a[i];
    for (int j = 2; j * j <= a[i]; j++) {
      long long p = 0;
      if (sieve[j] != j) continue;
      while (s % j == 0) p++, s /= j;
      if (p == 0) continue;
      pr.insert(j);
      fact[a[i]][j] = p;
    }
    if (s == 1) continue;
    pr.insert(s);
    fact[a[i]][s] = 1;
  }
  long long x = 0;
  for (auto p : pr) {
    int mask = 0;
    for (int i = 1; i <= n; i++) {
      mask |= (1 << fact[a[i]][p]);
    }
    dp.clear();
    dp[1] = {0, 1};
    x ^= solve(mask);
  }
  if (x > 0)
    cout << "Mojtaba";
  else
    cout << "Arpa";
  return 0;
}
