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;
template <class T>
using min_pq = priority_queue<T, vector<T>, greater<T>>;
const int MAXN = 3e5 + 10, MAXQ = 3e5 + 10, MAXL = 20, ALP = 26,
          MOD = 998244353, MAXK = 17, MAXA = 30, MAXB = 24, MAXBB = (1 << MAXB);
const string no = "NO\n", yes = "YES\n";
const int hA[4] = {1, 0, -1, 0}, kA[4] = {0, 1, 0, -1};
const long long INF = 1e18 + 10;
int a[MAXN];
map<long long, int> memo;
vector<pair<long long, int>> get_pf_big(long long n) {
  vector<pair<long long, int>> r;
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) {
      r.emplace_back(i, 0);
      while (n % i == 0) r.back().second++, n /= i;
    }
  if (n > 1) r.emplace_back(n, 1);
  return r;
}
int mex(set<int> s) {
  int c = 0;
  while (s.count(c)) c++;
  return c;
}
int grundy(long long mask) {
  if (memo.count(mask)) return memo[mask];
  auto trans = [&](int sub) {
    long long n_sub = mask >> sub;
    return n_sub | (mask & ((1ll << (sub - 1)) - 1));
  };
  set<int> s;
  for (int i = 1; trans(i) < mask; i++) {
    long long nxt = trans(i);
    assert(nxt <= mask);
    s.insert(grundy(nxt));
  }
  return memo[mask] = mex(s);
}
void solve() {
  int n;
  cin >> n;
  map<int, long long> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    auto pf = get_pf_big(a[i]);
    for (auto& it : pf) mp[it.first] |= 1ll << (it.second - 1);
  }
  int ans = 0;
  for (auto& it : mp) {
    ans ^= grundy(it.second);
    cerr << it.first << ' ' << it.second << ' ' << grundy(it.second) << endl;
  }
  cout << (ans ? "Mojtaba" : "Arpa") << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t_c = 1;
  while (t_c--) solve();
}
