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 T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2>& p) {
  out << "{" << p.first << ", " << p.second << "} ";
  return out;
}
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& p) {
  in >> p.first >> p.second;
  return in;
}
template <typename T>
istream& operator>>(istream& in, vector<T>& arr) {
  for (auto& i : arr) in >> i;
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T>& arr) {
  for (auto i : arr) out << i << ' ';
  out << '\n';
  return out;
}
int64_t n;
vector<int64_t> a;
char was[(int64_t)1e6 + 1];
map<int64_t, set<int64_t>> delit;
map<set<int64_t>, int64_t> tot_eshe_kal;
void pull(vector<pair<int64_t, int64_t>>& cnt) {
  for (int64_t i = 0; i < cnt.size(); ++i) {
    delit[cnt[i].first].insert(cnt[i].second);
  }
}
void pre() {
  for (auto el : a) {
    if (el > 1) {
      vector<pair<int64_t, int64_t>> cnt;
      int64_t del = 2;
      while (del * del <= el) {
        if (el % del == 0) {
          int64_t ccnt = 0;
          while (el % del == 0) {
            ccnt++;
            el /= del;
          }
          cnt.push_back({del, ccnt});
        }
        del++;
      }
      if (el > 1) {
        cnt.push_back({el, 1});
      }
      pull(cnt);
    }
  }
}
int64_t grundy(set<int64_t> ss) {
  if (ss.empty()) {
    return 0;
  }
  if (tot_eshe_kal.count(ss)) {
    return tot_eshe_kal[ss];
  }
  vector<int64_t> singr;
  for (int64_t stepen = 1; stepen <= *ss.rbegin(); ++stepen) {
    set<int64_t> nextkal;
    for (auto el : ss) {
      if (el != stepen) {
        nextkal.insert(el > stepen ? el - stepen : el);
      }
    }
    singr.push_back(grundy(nextkal));
  }
  for (int64_t i = 0; i < singr.size(); ++i) {
    was[singr[i]] = 1;
  }
  int64_t mex = 0;
  while (was[mex]) {
    mex++;
  }
  memset(was, 0, sizeof(was));
  return tot_eshe_kal[ss] = mex;
}
signed main() {
  cin >> n;
  a.resize(n);
  cin >> a;
  pre();
  int64_t ans = 0;
  for (auto el : delit) {
    ans ^= grundy(el.second);
  }
  if (ans == 0) {
    cout << "Arpa";
  } else {
    cout << "Mojtaba";
  }
  return 0;
}
