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 N = 1048576;
int n;
struct Node {
  int pri;
  int val;
} xu[N];
int cc;
int dp[N];
int ever[N];
int getint() {
  char ch = getchar();
  int res = 0;
  while (ch < '0' || ch > '9') ch = getchar();
  while ('0' <= ch && ch <= '9') {
    res = res * 10 + ch - '0';
    ch = getchar();
  }
  return res;
}
bool cmp(Node x, Node y) {
  if (x.pri < y.pri) return 1;
  if (x.pri > y.pri) return 0;
  return (x.val < y.val);
}
int Dfs(int x) {
  if (x < N) return dp[x];
  bool eve[32] = {0};
  int j;
  for (j = 1;; j++) {
    int a = (x >> (j - 1));
    if (!a) break;
    int b = (x ^ (a << (j - 1)));
    b = (b | (a >> 1));
    eve[Dfs(b)] = 1;
  }
  for (j = 0; eve[j]; j++)
    ;
  return j;
}
int SG(int l, int r) {
  int now = 0;
  int i;
  for (i = l; i <= r; i++) {
    now |= (1 << (xu[i].val - 1));
  }
  if (now < N) return dp[now];
  return Dfs(now);
}
int main() {
  int i, j;
  cin >> n;
  for (i = 1; i <= n; i++) {
    int now = getint();
    for (j = 2; j * j <= now; j++) {
      if (now % j == 0) {
        cc++;
        xu[cc].pri = j;
        xu[cc].val = 0;
        while (now % j == 0) {
          xu[cc].val++;
          now /= j;
        }
      }
    }
    if (now > 1) {
      cc++;
      xu[cc].pri = now;
      xu[cc].val = 1;
    }
  }
  dp[0] = 0;
  for (i = 1; i < N; i++) {
    for (j = 1;; j++) {
      int a = (i >> (j - 1));
      if (!a) break;
      int b = (i ^ (a << (j - 1)));
      b = (b | (a >> 1));
      ever[dp[b]] = i;
    }
    for (j = 0; ever[j] == i; j++)
      ;
    dp[i] = j;
  }
  int ans = 0;
  if (cc) {
    sort(xu + 1, xu + cc + 1, cmp);
    for (i = 1; i <= cc; i++) {
      int s = i;
      while (i < cc && xu[i].pri == xu[i + 1].pri) i++;
      ans ^= SG(s, i);
    }
  }
  if (ans)
    printf("Mojtaba\n");
  else
    printf("Arpa\n");
  return 0;
}
