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>
void test(T a) {
  cout << a << endl;
}
template <class T, class T2>
void test(T a, T2 b) {
  cout << a << " " << b << endl;
}
template <class T, class T2, class T3>
void test(T a, T2 b, T3 c) {
  cout << a << " " << b << " " << c << endl;
}
const int N = 2e6 + 10;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-15;
const long long mod = 1000000007;
bool isprime[N];
vector<int> prime;
void getprime() {
  memset(isprime, 1, sizeof(isprime));
  isprime[0] = isprime[1] = 0;
  for (int i = 2; i <= (1e5); i++) {
    if (isprime[i]) prime.push_back(i);
    for (int j = 2 * i; j < 1e5; j += i) {
      isprime[j] = 0;
    }
  }
}
set<int> ve[N];
map<long long, int> dp;
int cal(long long x) {
  if (dp.find(x) != dp.end()) return dp[x];
  if (!x) return x;
  int vis[55] = {0};
  int k = 0;
  for (int i = 0; i < (40); i++) {
    if (x & (1ll << i)) k = i;
  }
  for (int i = k; i >= 0; i--) {
    long long y = (x >> i + 1) | (x & ((1ll << i) - 1));
    vis[cal(y)] = 1;
  }
  for (int i = 0; i < (40); i++)
    if (!vis[i]) return dp[x] = i;
}
void work() {
  int n;
  cin >> n;
  int v;
  map<int, int> Hash;
  int idx = 0;
  for (int i = 0; i < (n); i++) {
    cin >> v;
    for (int i = 0; i < ((int)prime.size()); i++) {
      int cnt = 0;
      if (prime[i] > v) break;
      while (v % prime[i] == 0) {
        cnt++;
        v /= prime[i];
      }
      if (cnt) {
        if (Hash.find(prime[i]) == Hash.end()) {
          Hash[prime[i]] = idx++;
        }
        int id = Hash[prime[i]];
        ve[id].insert(cnt);
      }
    }
    if (v && v - 1) {
      if (Hash.find(v) == Hash.end()) {
        Hash[v] = idx++;
      }
      int id = Hash[v];
      ve[id].insert(1);
    }
  }
  map<int, int>::iterator it;
  int ans = 0;
  for (it = Hash.begin(); it != Hash.end(); it++) {
    auto p = *it;
    int id = p.second;
    long long x = 0;
    for (auto stit = ve[id].begin(); stit != ve[id].end(); stit++) {
      int v = *stit;
      x |= (1ll << (v - 1));
    }
    ans ^= cal(x);
  }
  if (ans)
    test("Mojtaba");
  else
    test("Arpa");
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  getprime();
  work();
}
