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;
#pragma comment(linker, "/STACK:102400000,102400000")
long long mul(long long a, long long b) { return (a * b) % (1000000007); }
long long add(long long a, long long b) { return (a + b) % (1000000007); }
long long sub(long long a, long long b) {
  return ((a - b) % (1000000007) + (1000000007)) % (1000000007);
}
void upd(long long &a, long long b) {
  a = (a % (1000000007) + b % (1000000007)) % (1000000007);
}
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int p[(101000)], tot;
bool b[(101000)] = {0};
void make_prime(int n) {
  tot = 0;
  for (int i = 2; i <= n; i++) {
    if (!b[i]) p[++tot] = i;
    for (int j = 1; j <= tot; j++) {
      if (i * p[j] > n) break;
      b[i * p[j]] = 1;
      if (i % p[j] == 0) break;
    }
  }
}
long long n, a[(101000)], a2[(101000)];
long long f[1 << 21];
void calc() {
  int n = 20, S = 1 << 20;
  for (int st = 0; st < S; st++) {
    bool b[33] = {};
    for (int k = 1; k <= 20; k++)
      if ((1 << k - 1) <= st) {
        int nx = (st >> k) | (st & ((1 << k - 1) - 1));
        if (nx < st) b[f[nx]] = 1;
      }
    f[st] = 0;
    while (b[f[st]]) ++f[st];
  }
}
long long solve(long long st) {
  if (st < (1 << 20)) return f[st];
  bool b[33] = {};
  for (int k = 1; k <= 32; k++)
    if ((1LL << k - 1) <= st) {
      long long nx = (st >> k) | (st & ((1 << k - 1) - 1));
      b[solve(nx)] = 1;
    }
  long long ans = 0;
  while (b[ans]) ++ans;
  return ans;
}
long long calc(int n) {
  sort(a + 1, a + 1 + n);
  n = unique(a + 1, a + 1 + n) - (a + 1);
  int st = 0;
  for (int i = 1; i <= n; i++)
    if (a[i]) st |= 1 << a[i] - 1;
  return solve(st);
}
int c[(101000)];
int main() {
  n = read();
  calc();
  for (int i = 1; i <= n; i++) c[i] = read();
  make_prime(100000);
  long long ans = 0;
  for (int i = 1; i <= tot; i++) {
    bool f = 0;
    for (int j = 1; j <= n; j++) {
      a[j] = 0;
      while (c[j] % p[i] == 0) f = 1, c[j] /= p[i], ++a[j];
    }
    if (f) {
      long long p = calc(n);
      ans ^= p;
    }
  }
  for (int i = 1; i <= n; i++)
    if (c[i] > 1) {
      int p = c[i];
      for (int j = 1; j <= n; j++)
        if (c[j] == p) c[j] = 1;
      ans ^= 1;
    }
  puts(ans ? "Mojtaba" : "Arpa");
  return 0;
}
