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 double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const long long infLL = 9000000000000000000;
inline bool checkBit(long long n, int i) { return n & (1LL << i); }
inline long long setBit(long long n, int i) {
  return n | (1LL << i);
  ;
}
inline long long resetBit(long long n, int i) { return n & (~(1LL << i)); }
int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline bool isLeapYear(long long year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
inline void normal(long long &a) {
  a %= 1000000007;
  (a < 0) && (a += 1000000007);
}
inline long long modMul(long long a, long long b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  return (a * b) % 1000000007;
}
inline long long modAdd(long long a, long long b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  return (a + b) % 1000000007;
}
inline long long modSub(long long a, long long b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline long long modPow(long long b, long long p) {
  long long r = 1;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1;
  }
  return r;
}
inline long long modInverse(long long a) { return modPow(a, 1000000007 - 2); }
inline long long modDiv(long long a, long long b) {
  return modMul(a, modInverse(b));
}
bool seive[1010000];
vector<int> prime;
void seiveGen(int limit) {
  limit += 100;
  int sqrtn = sqrt(limit);
  for (int i = 3; i <= sqrtn; i += 2) {
    if (!seive[i >> 1]) {
      for (int j = i * i; j < limit; j += i + i) {
        seive[j >> 1] = 1;
      }
    }
  }
  prime.emplace_back(2);
  for (int i = 3; i < limit; i += 2) {
    if (!seive[i >> 1]) prime.emplace_back(i);
  }
}
map<int, int> dp;
set<int> store;
map<int, int> exist;
int el[2000];
void factorise(int num) {
  for (int i = 0; 1LL * prime[i] * prime[i] <= num; ++i) {
    if (num % prime[i] == 0) {
      if (!exist.count(prime[i])) exist[prime[i]] = exist.size();
      int lol = exist[prime[i]];
      int cnt = 0;
      while (num % prime[i] == 0) {
        num /= prime[i];
        ++cnt;
      }
      el[lol] = setBit(el[lol], cnt - 1);
    }
  }
  if (num > 1) {
    if (!exist.count(num)) exist[num] = exist.size();
    int lol = exist[num];
    el[lol] = setBit(el[lol], 0);
  }
}
int grundy(int mask) {
  ;
  if (!mask) return 0;
  if (__builtin_popcount(mask) == 1) {
    return 32 - __builtin_clz(mask);
  }
  if (dp.count(mask)) return dp[mask];
  set<int> sstore = store;
  for (int i = 31 - __builtin_clz(mask); i >= 0; --i) {
    int tmask = (mask & (1 << i) - 1) | (mask >> (i + 1));
    sstore.erase(grundy(tmask));
  }
  dp[mask] = *sstore.begin();
  return dp[mask];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  seiveGen(1e5);
  for (int i = 0; i < 100; ++i) store.insert(i);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int num;
    cin >> num;
    if (num == 1) continue;
    factorise(num);
  }
  int ans = 0;
  for (int i = 1; i <= exist.size(); ++i) {
    ans ^= grundy(el[i]);
  }
  if (ans)
    cout << "Mojtaba" << '\n';
  else
    cout << "Arpa" << '\n';
  return 0;
}
