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;
int p[100000];
int m[31];
unordered_map<int, int> dp;
unordered_map<int, int> flag;
int spocti(int x) {
  if (x == 0) return 0;
  if (flag[x] == 1) return dp[x];
  int g = 2;
  vector<int> blbost;
  while (g <= 2 * x) {
    int y = spocti((x / g) | ((x % (g / 2))));
    blbost.push_back(y);
    g *= 2;
  }
  sort(blbost.begin(), blbost.end());
  flag[x] = 1;
  if (blbost[0] > 0) {
    dp[x] = 0;
    return dp[x];
  }
  for (g = 0; g < blbost.size() - 1; g++) {
    if (blbost[g] <= blbost[g + 1] - 2) {
      dp[x] = blbost[g] + 1;
      return dp[x];
    }
  }
  dp[x] = blbost[blbost.size() - 1] + 1;
  return dp[x];
}
int main(void) {
  int N;
  scanf("%i", &N);
  int i;
  int a[N];
  m[0] = 1;
  for (i = 1; i < 31; i++) {
    m[i] = 2 * m[i - 1];
  }
  for (i = 0; i < N; i++) {
    scanf("%i", &a[i]);
  }
  unordered_map<int, int> M;
  vector<int> pr;
  for (i = 2; i < 40000; i++) {
    if (p[i] == 0) {
      pr.push_back(i);
      for (int j = 2 * i; j < 40000; j += i) {
        p[j] = 1;
      }
    }
  }
  int x = pr[pr.size() - 1];
  int kolik = 0;
  vector<vector<int> > b(pr.size());
  for (i = 0; i < N; i++) {
    for (int j = 0; j < pr.size(); j++) {
      int ted = 0;
      while ((a[i] % pr[j]) == 0) {
        a[i] /= pr[j];
        ted++;
      }
      if (ted > 0) {
        b[j].push_back(ted);
      }
      if (a[i] == 1) break;
    }
    if (a[i] != 1) {
      if (M[a[i]] == 0) {
        kolik++;
        M[a[i]]++;
      }
    }
  }
  kolik %= 2;
  int res = 0;
  if (kolik == 1) res = 1;
  vector<int> c;
  c.resize(b.size(), 0);
  for (i = 0; i < b.size(); i++) {
    if (b[i].size() == 0) continue;
    sort(b[i].begin(), b[i].end());
    int newb = 0;
    newb += m[b[i][0] - 1];
    for (int j = 1; j < b[i].size(); j++) {
      if (b[i][j] != b[i][j - 1]) newb += m[b[i][j] - 1];
    }
    c[i] = spocti(newb);
  }
  for (i = 0; i < pr.size(); i++) {
    res = (res ^ c[i]);
  }
  if (res == 0)
    printf("Arpa\n");
  else
    printf("Mojtaba\n");
  return 0;
}
