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 a[105], pr[100005];
int primes[100005];
int masks[100005];
map<int, int> grundies;
map<int, int> memo;
inline int grundy(int mask) {
  if (mask == 0) {
    return memo[mask] = 0;
  }
  if (memo.count(mask)) {
    return memo[mask];
  }
  set<int> reachable_states;
  for (int k = 1; k <= 30; k++) {
    int new_mask = 0;
    for (int i = 1; i <= 30; i++) {
      if ((mask >> i) & 1) {
        if (i < k) {
          new_mask |= (1 << i);
        } else if (i > k) {
          new_mask |= (1 << (i - k));
        }
      }
    }
    if (new_mask != mask) {
      reachable_states.insert(grundy(new_mask));
    }
  }
  int mex = 0;
  while (reachable_states.count(mex)) {
    mex += 1;
  }
  return memo[mask] = mex;
}
map<int, int> sg;
int calGrundy(int maski) {
  int x = maski;
  if (sg.count(x)) return sg[x];
  int res = 0, mask = 0, tmp[32] = {};
  for (int i = 0; (1 << i) <= x; i++) {
    tmp[calGrundy((x & mask) | (x >> (i + 1)))] = 1;
    mask |= 1 << i;
  }
  while (tmp[res]) res++;
  return sg[x] = res;
  if (grundies.find(mask) != grundies.end()) return grundies[mask];
  set<int> s;
  int k;
  int po = 1;
  for (k = 0; k <= 30; k++) {
    if (mask & po) {
      int last = mask & (po - 1);
      int next = (mask >> (k)) | last;
      int nn = -1;
      if (next != mask) nn = calGrundy(next);
      s.insert(nn);
    }
    po *= 2;
  }
  for (k = 0;; k++)
    if (s.find(k) == s.end()) break;
  grundies[mask] = k;
  return grundies[mask];
}
int main() {
  int n, m, cur, hi = 100005, ind = 0;
  for (n = 2; n <= hi; n++)
    if (pr[n] == 0) {
      primes[ind++] = n;
      for (m = 2 * n; m <= hi; m += n) pr[m] = 1;
    }
  int i, j;
  grundies[0] = 0;
  grundies[1] = 0;
  scanf("%d", &n);
  map<int, int> masks;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    int mask = 0;
    m = a[i];
    for (j = 0; j < ind; j++) {
      int co = 0;
      while (m % primes[j] == 0) {
        m /= primes[j];
        co += 1;
      }
      if (co) masks[primes[j]] |= (1 << (co - 1));
    }
    if (m != 1) masks[m] |= 1;
  }
  int ans = 0;
  map<int, int>::iterator I;
  for (I = masks.begin(); I != masks.end(); I++) {
    ans ^= calGrundy(I->second);
  }
  if (ans)
    printf("Mojtaba\n");
  else
    printf("Arpa\n");
  return 0;
}
