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 <class T>
inline void gn(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 <class 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[111];
int prm[100011], flag[100011], vst[100011];
int np;
vector<int> vec[100011];
void pre() {
  for (int i = 2; i < 100011; i++)
    if (!flag[i]) {
      prm[np++] = i;
      if ((long long)i * i >= 100011) continue;
      for (int j = i * i; j < 100011; j += i) flag[j] = 1;
    }
}
map<vector<int>, int> mp;
map<int, int> dnf;
int calc(vector<int> vec) {
  if (mp[vec]) return mp[vec];
  int sz = vec.size();
  if (sz == 0) return 0;
  int mx = vec[sz - 1];
  int flag[33];
  memset(flag, 0, sizeof flag);
  vector<int> tmp;
  for (int i = 1; i <= mx; i++) {
    tmp.clear();
    for (int j = 0; j < sz; j++) {
      if (vec[j] > i) tmp.push_back(vec[j] - i);
      if (vec[j] < i) tmp.push_back(vec[j]);
    }
    if (((int)tmp.size()) == 0) {
      flag[0] = 1;
      continue;
    }
    sort(tmp.begin(), tmp.end());
    tmp.resize(unique(tmp.begin(), tmp.end()) - tmp.begin());
    flag[calc(tmp)] = 1;
  }
  int ans;
  for (int i = 0; i < 33; i++)
    if (!flag[i]) {
      ans = mp[vec] = i;
      break;
    }
  return ans;
}
int main() {
  pre();
  int n;
  gn(n);
  int nn = 0, cnt;
  for (int i = 0; i < n; i++) {
    gn(a[i]);
    if (a[i] == 1) continue;
    int flag = 1;
    for (int j = 0; j < np; j++) {
      if (a[i] % prm[j]) continue;
      cnt = 0;
      flag = 0;
      while (a[i] % prm[j] == 0) a[i] /= prm[j], cnt++;
      if (!vst[prm[j]]) vst[prm[j]] = ++nn;
      vec[vst[prm[j]]].push_back(cnt);
    }
    if (a[i] > 1) {
      if (dnf[a[i]] == 0) dnf[a[i]] = ++nn;
      vec[dnf[a[i]]].push_back(1);
    }
  }
  for (int i = 1; i <= nn; i++) {
    sort(vec[i].begin(), vec[i].end()),
        vec[i].resize(unique(vec[i].begin(), vec[i].end()) - vec[i].begin());
  }
  int ans = 0;
  for (int i = 1; i <= nn; i++) {
    ans ^= calc(vec[i]);
  }
  if (ans)
    puts("Mojtaba");
  else
    puts("Arpa");
  return 0;
}
