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>
const long long N = 1000006;
using namespace std;
const long long MOD = 1000000007LL;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T power(T x, T y, long long m = MOD) {
  T ans = 1;
  while (y > 0) {
    if (y & 1LL) ans = (ans * x) % m;
    y >>= 1LL;
    x = (x * x) % m;
  }
  return ans % m;
}
long long minprime[N];
vector<long long> primes;
void pre() {
  for (long long i = 2; i * i < N; i++) {
    if (minprime[i] == 0) {
      for (long long j = i * i; j < N; j += i)
        if (minprime[j] == 0) minprime[j] = i;
    }
  }
  for (long long(i) = (2); i < (N); i++) {
    if (minprime[i] == 0) {
      minprime[i] = i;
      primes.emplace_back(i);
    }
  }
}
map<vector<long long>, long long> dp;
long long brute(vector<long long> v) {
  set<long long> vs;
  for (auto i : v) vs.insert(i);
  v.clear();
  for (auto i : vs) v.emplace_back(i);
  if (dp[v]) return dp[v];
  bool f = 0;
  for (auto i : v)
    if (i) f = 1;
  if (!f) return dp[v] = 0;
  long long n = v.size();
  long long maxi = v.back();
  set<long long> s;
  for (long long(i) = (1); i < (maxi + 1); i++) {
    vector<long long> temp = v;
    for (auto &x : temp) {
      if (x >= i) x -= i;
    }
    s.insert(brute(temp));
  }
  long long ct = 0;
  while (s.find(ct) != s.end()) ++ct;
  return dp[v] = ct;
}
long long a[N];
map<long long, long long> ipr;
long long isprime(long long n) {
  if (n == 1) return -1;
  if (ipr[n]) return ipr[n];
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return ipr[n] = -1;
  }
  return ipr[n] = 1;
}
map<long long, vector<long long> > vs;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  pre();
  long long ans = 0;
  long long n;
  cin >> n;
  set<long long> act;
  for (long long(i) = (0); i < (n); i++) {
    cin >> a[i];
    for (long long j = 1; j * j <= a[i]; j++) {
      if (a[i] % j != 0) continue;
      long long x = a[i] / j, y = j;
      if (isprime(x) > 0) {
        long long ct = 0;
        long long temp = a[i];
        while (temp % x == 0) {
          temp /= x;
          ++ct;
        }
        vs[x].emplace_back(ct);
        act.insert(x);
      }
      if (isprime(y) > 0) {
        long long ct = 0;
        long long temp = a[i];
        while (temp % y == 0) {
          temp /= y;
          ++ct;
        }
        vs[y].emplace_back(ct);
        act.insert(y);
      }
    }
  }
  for (auto x : act) {
    ans ^= brute(vs[x]);
  }
  if (ans)
    cout << "Mojtaba";
  else
    cout << "Arpa";
}
