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 long long modn = 1000000007;
inline long long mod(long long x) { return x % modn; }
template <class num>
inline void rd(num &x) {
  char c;
  while (isspace(c = getchar()))
    ;
  bool neg = false;
  if (!isdigit(c))
    neg = (c == '-'), x = 0;
  else
    x = c - '0';
  while (isdigit(c = getchar())) x = (x << 3) + (x << 1) + c - '0';
  if (neg) x = -x;
}
int n;
const int M = 212345;
vector<int> ps;
map<int, vector<int>> psl;
map<vector<int>, int> memo;
int solve(const vector<int> &f) {
  if (f.empty()) return 0;
  if (memo.count(f)) return memo[f];
  int &ans = memo[f];
  vector<int> seen;
  int mx = f.back();
  for (int i = 1; i <= mx; i++) {
    vector<int> g;
    for (int x : f)
      if (x > i)
        g.push_back(x - i);
      else if (x < i)
        g.push_back(x);
    if (g.empty()) {
      seen.push_back(0);
      continue;
    }
    sort(g.begin(), g.end());
    g.erase(unique(g.begin(), g.end()), g.end());
    seen.push_back(solve(g));
  }
  sort(seen.begin(), seen.end());
  seen.erase(unique(seen.begin(), seen.end()), seen.end());
  for (int i = 0; i < int(seen.size()); i++)
    if (seen[i] != i) return ans = i;
  return ans = int(seen.size());
}
int cp[M], a[M];
int main() {
  int i, j;
  rd(n);
  for (i = 2; i * i <= 1000000009; i++)
    if (!cp[i]) {
      ps.push_back(i);
      for (long long j = i + i; j < M; j += i) cp[j] = 1;
    }
  for (i = 0; i < n; i++) {
    rd(a[i]);
    for (int p : ps) {
      int d = 0;
      for (; !(a[i] % p); d++) a[i] /= p;
      if (d > 0) psl[p].push_back(d);
    }
    if (a[i] > 1) psl[a[i]].push_back(1);
  }
  int x = 0;
  for (auto &e : psl) {
    vector<int> &f = e.second;
    sort(f.begin(), f.end());
    f.erase(unique(f.begin(), f.end()), f.end());
    x ^= solve(f);
  }
  if (x)
    puts("Mojtaba");
  else
    puts("Arpa");
}
