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;
long long MOD = 998244353;
long long pwr(long long x, long long y, long long mod = MOD) {
  long long res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
inline long long addmod(long long a, long long b) { return ((a + b) % MOD); }
inline long long mulmod(long long a, long long b) { return ((a * b) % MOD); }
bool check_composite(int n, int a, int d, int s) {
  int x = pwr(a, d, n);
  if (x == 1 || x == n - 1) return false;
  for (int r = 1; r < s; r++) {
    x = x * x % n;
    if (x == n - 1) return false;
  }
  return true;
};
const int first12prime[12] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
bool isPrime(int n) {
  if (n < 2) return false;
  int r = 0;
  int d = n - 1;
  while ((d & 1) == 0) {
    d >>= 1;
    r++;
  }
  for (int i = 0; i < 12; i++) {
    int a = first12prime[i];
    if (n == a) return true;
    if (check_composite(n, a, d, r)) return false;
  }
  return true;
}
const int PM = 5e4;
vector<int> primes;
vector<bool> is_comp;
void sieve() {
  is_comp.resize(PM, false);
  for (int i = 2; i < PM; i++) {
    if (!is_comp[i]) primes.push_back(i);
    for (int j = 0; j < primes.size() && primes[j] * i < PM; j++) {
      is_comp[primes[j] * i] = true;
      if (i % primes[j] == 0) break;
    }
  }
}
inline int sfunc(int a, int b) { return a + b; }
int n;
int *stree;
void build() {
  for (int i = n - 1; i > 0; --i)
    stree[i] = sfunc(stree[i << 1], stree[i << 1 | 1]);
}
void modify(int p, int value) {
  for (stree[p += n] = value; p > 1; p >>= 1)
    stree[p >> 1] = sfunc(stree[p], stree[p ^ 1]);
}
int query(int l, int r) {
  int res = 0;
  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    if (l & 1) res = sfunc(res, stree[l++]);
    if (r & 1) res = sfunc(res, stree[--r]);
  }
  return res;
}
int c, m;
int par[1001];
int siz[1001];
int find(int u) {
  int u2 = u;
  while (u ^ par[u]) u = par[u];
  par[u2] = u;
  return u;
}
int join(int u, int v) {
  int p1 = find(u);
  int p2 = find(v);
  if (siz[p1] < siz[p2]) {
    par[p1] = p2;
    siz[p2] += siz[p1];
    return p2;
  } else {
    par[p2] = p1;
    siz[p1] += siz[p2];
    return p1;
  }
}
inline int myceil(int a, int b) { return (a % b == 0 ? a / b : a / b + 1); }
map<int, int> grundy;
int calcGrun(int x) {
  if (grundy.find(x) != grundy.end()) return grundy[x];
  int k = 1, i = 1;
  set<int> nums;
  while (i <= x) {
    nums.insert(calcGrun((x & ((1 << (k - 1)) - 1)) | (x >> k)));
    i <<= 1;
    k++;
  }
  i = 0;
  for (int z : nums) {
    if (z > i) break;
    i++;
  }
  return grundy[x] = i;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  sieve();
  int n;
  cin >> n;
  int a, a2;
  int xr = 0;
  map<int, int> pr_vals;
  for (int i = 0; i < n; i++) {
    cin >> a;
    a2 = a;
    for (int p : primes) {
      if (p > a) break;
      int cur = 0;
      while (a % p == 0) {
        a /= p;
        cur++;
      }
      if (cur) {
        pr_vals[p] |= 1LL << (cur - 1);
      }
    }
    if (a > 1) pr_vals[a2] = 1;
  }
  for (pair<long long, long long> x : pr_vals) xr ^= calcGrun(x.second);
  cout << (xr == 0 ? "Arpa\n" : "Mojtaba\n");
}
