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 int INF = 0x3f2f1f0f;
const long long LINF = 1ll * INF * INF;
const int MAX_NR = 4e4 + 10, MAX_N = 1e2 + 10;
int N, Nr[MAX_N];
vector<int> Ps;
bool notP[MAX_NR];
map<vector<int>, int> Mp;
int getG(vector<int> &val) {
  if (Mp.count(val) != 0) return Mp[val];
  vector<int> nval;
  set<int> S;
  int now = 0;
  for (int i = 0; i < ((int)(val).size()); i++) {
    if (val[i] > now) {
      for (int l = now + 1; l <= val[i]; l++) {
        nval.clear();
        for (int j = 0; j < i; j++) nval.push_back(val[j]);
        for (int j = i; j < ((int)(val).size()); j++)
          nval.push_back(val[j] - l);
        sort((nval).begin(), (nval).end());
        nval.erase(unique((nval).begin(), (nval).end()), nval.end());
        S.insert(getG(nval));
      }
      now = val[i];
    }
  }
  int cnt = 0;
  for (int x : S) {
    if (x != cnt) break;
    cnt++;
  }
  return Mp[val] = cnt;
}
int main() {
  notP[0] = notP[1] = true;
  for (int i = 2; i < MAX_NR; i++)
    if (notP[i] == false) {
      Ps.push_back(i);
      for (int j = i + i; j < MAX_NR; j += i) notP[j] = true;
    }
  cin >> N;
  for (int i = 0; i < N; i++) {
    scanf("%d", &Nr[i]);
  }
  int ans = 0;
  for (int p : Ps) {
    vector<int> val;
    for (int i = 0; i < N; i++) {
      int cnt = 0;
      while (Nr[i] % p == 0) Nr[i] /= p, cnt++;
      val.push_back(cnt);
    }
    sort((val).begin(), (val).end());
    val.erase(unique((val).begin(), (val).end()), val.end());
    ans ^= getG(val);
  }
  vector<int> rest;
  for (int i = 0; i < N; i++)
    if (Nr[i] != 1) rest.push_back(Nr[i]);
  sort((rest).begin(), (rest).end());
  rest.erase(unique((rest).begin(), (rest).end()), rest.end());
  for (int p : rest) {
    vector<int> val;
    for (int i = 0; i < N; i++) {
      int cnt = 0;
      while (Nr[i] % p == 0) Nr[i] /= p, cnt++;
      val.push_back(cnt);
    }
    sort((val).begin(), (val).end());
    ans ^= getG(val);
  }
  if (ans == 0)
    puts("Arpa");
  else
    puts("Mojtaba");
  return 0;
}
