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;
int SET(int n, int pos) { return n = n | (1 << pos); }
int RESET(int n, int pos) { return n = n & ~(1 << pos); }
int CHECK(int n, int pos) { return (bool)(n & (1 << pos)); }
int str2int(string s) {
  stringstream ss(s);
  int x;
  ss >> x;
  return x;
}
string int2str(int a) {
  stringstream ss;
  ss << a;
  string str = ss.str();
  return str;
}
string char2str(char a) {
  stringstream ss;
  ss << a;
  string str = ss.str();
  return str;
}
long long int bigMod(long long int n, long long int power, long long int MOD) {
  if (power == 0) return 1;
  if (power % 2 == 0) {
    long long int ret = bigMod(n, power / 2, MOD);
    return ((ret % MOD) * (ret % MOD)) % MOD;
  } else
    return ((n % MOD) * (bigMod(n, power - 1, MOD) % MOD)) % MOD;
}
long long int modInverse(long long int a, long long int m) {
  long long int m0 = m, t, q;
  long long int x0 = 0, x1 = 1;
  if (m == 1) return 0;
  while (a > 1) {
    q = a / m;
    t = m;
    m = a % m, a = t;
    t = x0;
    x0 = x1 - q * x0;
    x1 = t;
  }
  if (x1 < 0) x1 += m0;
  return x1;
}
int POW(int x, int y) {
  int res = 1;
  for (; y;) {
    if ((y & 1)) {
      res *= x;
    }
    x *= x;
    y >>= 1;
  }
  return res;
}
int inverse(int x) {
  double p = ((double)1.0) / x;
  return (p) + 1e-9;
}
int gcd(int a, int b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
int nC2(int n) { return n * (n - 1) / 2; }
long long int MOD(long long int n, long long int mod) {
  if (n >= 0)
    return n % mod;
  else if (-n == mod)
    return 0;
  else
    return mod + (n % mod);
}
int n;
bool isPrime[100005];
vector<long long int> prime;
set<long long int> primeSet;
set<long long int>::iterator it;
map<long long int, long long int> primeMaskValue, dp;
map<long long int, bool> vis;
void seive_N_logN(long long int N) {
  memset(isPrime, true, sizeof isPrime);
  prime.clear();
  isPrime[1] = false;
  for (long long int i = 4; i <= N; i = i + 2) isPrime[i] = false;
  for (long long int i = 3; i * i <= N; i = i + 2) {
    if (isPrime[i]) {
      for (long long int j = i * i; j <= N; j += i) isPrime[j] = false;
    }
  }
  for (long long int i = 1; i < N; i++)
    if (isPrime[i]) prime.push_back(i);
}
void func(long long int a) {
  for (int i = 0; prime[i] * prime[i] <= a; i++) {
    if (a % prime[i] == 0) {
      int cnt = 0;
      while (a % prime[i] == 0) {
        a /= prime[i];
        cnt++;
      }
      primeMaskValue[prime[i]] |= (1 << cnt);
      primeSet.insert(prime[i]);
    }
  }
  if (a > 1) {
    primeMaskValue[a] |= 1 << 1;
    primeSet.insert(a);
  }
}
long long int call(long long int mask) {
  long long int &ret = dp[mask];
  if (vis[mask]) return ret;
  vis[mask] = 1;
  ret = 0;
  set<long long int> sata;
  for (int i = 1; i < 32; i++) {
    long long int newMask = (mask >> i) | (((1 << i) - 1) & mask);
    if (newMask != mask) {
      long long int x = call(newMask);
      sata.insert(x);
    }
  }
  int mn = 0;
  while (sata.find(mn) != sata.end()) mn++;
  ret = mn;
  return ret;
}
int main() {
  int t, cas = 0;
  seive_N_logN(100005 - 2);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    long long int a;
    scanf("%lld", &a);
    func(a);
  }
  long long int ans = 0;
  for (it = primeSet.begin(); it != primeSet.end(); it++) {
    vis.clear();
    long long int a = *it;
    ans ^= call(primeMaskValue[a]);
  }
  if (ans)
    printf("Mojtaba\n");
  else
    printf("Arpa\n");
  return 0;
}
