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.0);
const double eps = 1e-11;
template <class T>
T sqr(const T &x) {
  return x * x;
}
template <class T>
T lowbit(const T &x) {
  return (x ^ (x - 1)) & x;
}
template <class T>
int countbit(const T &n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
template <class T>
void ckmin(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
void ckmax(T &a, const T &b) {
  if (b > a) a = b;
}
const int maxn = 128;
const int M = (1 << 20);
template <class T>
inline vector<pair<T, int>> factorize(T n) {
  vector<pair<T, int>> R;
  for (T i = 2; n > 1;) {
    if (n % i == 0) {
      int C = 0;
      for (; n % i == 0; C++, n /= i)
        ;
      R.push_back(make_pair(i, C));
    }
    i++;
    if (i > n / i) i = n;
  }
  if (n > 1) R.push_back(make_pair(n, 1));
  return R;
}
int n;
unordered_map<int, set<int>> w;
unordered_map<int, int> htable;
int f[M];
int solve(int set) {
  if (set == 0) return 0;
  if (set < M && f[set] >= 0) return f[set];
  if (set >= M) {
    auto it = htable.find(set);
    if (it != htable.end()) return it->second;
  }
  unordered_set<int> visited;
  for (int p = 0;; p++) {
    int s1 = (set & ((1 << p) - 1));
    int s2 = (set >> (p + 1));
    int w = (s1 | s2);
    if (w == set) break;
    visited.insert(solve(w));
  }
  int ret = 0;
  for (; visited.count(ret); ++ret)
    ;
  if (set < M)
    f[set] = ret;
  else
    htable[set] = ret;
  return ret;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  memset(f, 255, sizeof(f));
  while (cin >> n) {
    w.clear();
    for (int i = 0; i < (n); ++i) {
      int p;
      cin >> p;
      auto a = factorize(p);
      for (auto e : a) w[e.first].insert(e.second);
    }
    int ret = 0;
    for (auto &e : w) {
      int set = 0;
      for (int p : e.second) set |= (1 << (p - 1));
      ret ^= solve(set);
    }
    if (ret == 0)
      printf("Arpa\n");
    else
      printf("Mojtaba\n");
    break;
  }
  return 0;
}
