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 GLL(long long& x) { return scanf("%lld", &x); }
int GI(int& x) { return scanf("%d", &x); }
long long mul(long long a, long long b, long long m) {
  long long res = 0;
  for (long long i = 1; i <= b; i *= 2, (a *= 2) %= m)
    if (b & i) (res += a) %= m;
  return res;
}
long long pow(long long n, long long k, long long m) {
  if (k == 0) return 1;
  if (k % 2 == 1) return mul(n, pow(n, k - 1, m), m);
  n = pow(n, k / 2, m);
  return mul(n, n, m);
}
bool witness(long long a, long long n) {
  long long x, y, u, t;
  for (u = n - 1, t = 0; u % 2 == 0; u /= 2, t++)
    ;
  x = pow(a, u, n);
  while (t--) {
    y = x;
    x = pow(x, 2, n);
    if (x == 1 && y != 1 && y != n - 1) return 1;
  }
  return x != 1;
}
bool miller_rabin(long long n) {
  if (n - 1 >= 2 && witness(2, n)) return 0;
  if (n - 1 >= 3 && witness(3, n)) return 0;
  if (n - 1 >= 5 && witness(5, n)) return 0;
  if (n - 1 >= 179 && witness(179, n)) return 0;
  if (n - 1 >= 9137 && witness(9137, n)) return 0;
  if (n - 1 >= 28087 && witness(28087, n)) return 0;
  return 1;
}
long long g(long long x, long long n) { return (mul(x, x, n) + 1) % n; }
long long gcd(long long x, long long y) {
  while (y) {
    long long t = x % y;
    x = y;
    y = t;
  }
  return x;
}
long long pollard_rho(long long n) {
  long long start = 2;
  while (true) {
    long long x = start;
    long long y = start;
    long long f = 1;
    while (f == 1) {
      x = g(x, n);
      y = g(g(y, n), n);
      f = gcd(abs(x - y), n);
    }
    if (f == n) {
      start++;
    } else {
      return f;
    }
  }
}
vector<long long> factorize(long long n) {
  vector<long long> factors;
  if (miller_rabin(n)) {
    factors.push_back(n);
    return factors;
  }
  for (long long i = 2; i * i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        factors.push_back(i);
        n /= i;
      }
    }
  }
  if (n == 1) return factors;
  if (miller_rabin(n)) {
    factors.push_back(n);
    return factors;
  }
  long long sn = (long long)sqrt(n);
  while (sn * sn > n) sn--;
  while (sn * sn < n) sn++;
  if (sn * sn == n) {
    factors.push_back(sn);
    factors.push_back(sn);
    return factors;
  } else {
    long long f = pollard_rho(n);
    factors.push_back(f);
    factors.push_back(n / f);
  }
  return factors;
}
int mask(int x) { return 1 << x; }
bool contains(int s, int x) { return s & mask(x); }
int n, a;
map<int, int> start;
map<int, int> pow2exp;
map<int, int> dp;
vector<int> grundy;
int solve(int x) {
  if (dp.count(x)) return dp[x];
  int& res = dp[x];
  if (__builtin_popcount(x) == 1) {
    res = pow2exp[x];
    return res;
  }
  set<int> transitions;
  for (int i = 1; i < 30; i++) {
    if (mask(i) > x) break;
    int xx = (x & (mask(i) - 1)) | (x >> i);
    transitions.insert(solve(xx));
  }
  while (transitions.count(res)) {
    res++;
  }
  return res;
}
int main() {
  for (int i = 0; i < (int)(30); i++) pow2exp[mask(i)] = i;
  GI(n);
  for (int i = 0; i < (int)(n); i++) {
    GI(a);
    map<int, int> cnt;
    for (auto& f : factorize(a)) cnt[f]++;
    for (auto& kv : cnt) {
      start[kv.first] |= mask(kv.second);
    }
  }
  dp[0] = dp[1] = 0;
  for (auto& kv : start) {
    if (kv.first > 1) {
      grundy.push_back(solve(kv.second));
    }
  }
  int res = 0;
  for (auto& x : grundy) {
    res ^= x;
  }
  if (res == 0) {
    printf("Arpa\n");
  } else {
    printf("Mojtaba\n");
  }
  return 0;
}
