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 <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <typename T>
inline void getint(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <typename T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int a[100010], p[100010], pk, vst[100010];
int pp[100010];
void prime() {
  for (int i = 2; i < 100010; i++) {
    if (vst[i]) continue;
    p[pk++] = i;
    if (i > 1000) continue;
    for (int j = i * i; j < 100010; j += i) vst[j] = 1;
  }
}
map<int, int> mp[111];
map<vector<int>, int> g;
int solve(vector<int> v) {
  if (g.count(v)) return g[v];
  if (v.empty()) return g[v] = 0;
  if (v.size() == 1) return g[v] = v.back();
  vector<bool> vst = vector<bool>(v.back() + 20, 0);
  for (int i = 1; i <= v.back(); i++) {
    vector<int> vv = vector<int>(0);
    for (int j = 0; j < v.size(); j++) {
      if (v[j] < i) vv.push_back(v[j]);
      if (v[j] > i) vv.push_back(v[j] - i);
    }
    sort(vv.begin(), vv.end());
    vv.resize(unique(vv.begin(), vv.end()) - vv.begin());
    vst[solve(vv)] = 1;
  }
  for (int i = 0; i < v.back() + 20; i++)
    if (!vst[i]) return g[v] = i;
}
int main() {
  prime();
  int n, m = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    for (int j = 0; j < pk; j++) {
      int k = 0;
      while (a[i] % p[j] == 0) k++, a[i] /= p[j];
      if (k) {
        pp[m++] = p[j];
        mp[i][p[j]] = k;
      }
    }
    if (a[i] > 1) {
      mp[i][a[i]] = 1;
      pp[m++] = a[i];
    }
  }
  sort(pp, pp + m);
  m = unique(pp, pp + m) - pp;
  int ans = 0;
  for (int i = 0; i < m; i++) {
    vector<int> v = vector<int>(0);
    for (int j = 0; j < n; j++) {
      if (mp[j].count(pp[i])) v.push_back(mp[j][pp[i]]);
    }
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end()) - v.begin());
    ans ^= solve(v);
  }
  puts(!ans ? "Arpa" : "Mojtaba");
  return 0;
}
