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;
template <typename T>
T in() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
template <typename T>
inline T POW(T B, T P) {
  if (P == 0) return 1;
  if (P & 1)
    return B * POW(B, P - 1);
  else
    return (POW(B, P / 2) * POW(B, P / 2));
}
template <typename T>
inline T Gcd(T a, T b) {
  if (a < 0) return Gcd(-a, b);
  if (b < 0) return Gcd(a, -b);
  return (b == 0) ? a : Gcd(b, a % b);
}
template <typename T>
inline T Lcm(T a, T b) {
  if (a < 0) return Lcm(-a, b);
  if (b < 0) return Lcm(a, -b);
  return a * (b / Gcd(a, b));
}
long long Bigmod(long long base, long long power, long long MOD) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
bool isVowel(char ch) {
  ch = toupper(ch);
  if (ch == 'A' || ch == 'U' || ch == 'I' || ch == 'O' || ch == 'E')
    return true;
  return false;
}
template <typename T>
long long int isLeft(T a, T b, T c) {
  return (a.x - b.x) * (b.y - c.y) - (b.x - c.x) * (a.y - b.y);
}
long long ModInverse(long long number, long long MOD) {
  return Bigmod(number, MOD - 2, MOD);
}
bool isConst(char ch) {
  if (isalpha(ch) && !isVowel(ch)) return true;
  return false;
}
int toInt(string s) {
  int sm;
  stringstream second(s);
  second >> sm;
  return sm;
}
bool vis[100007];
int a[50007];
int ln;
void Prime() {
  for (int i = 2; i <= 31700; i++) {
    if (!vis[i]) {
      for (int j = i * 2; j <= 31700; j += i) {
        vis[j] = 1;
      }
      a[ln++] = i;
    }
  }
}
map<int, int> dp;
int grundy(int n) {
  if (n == 1 || n == 0) return 0;
  if (dp.find(n) != dp.end()) return dp[n];
  set<int> s;
  for (int i = 1; i <= 31; i++) {
    int xr = n & ((1 << (i)) - 1);
    xr |= (n >> (i));
    if (xr != n) s.insert(grundy(xr));
  }
  int res = 0;
  while (s.find(res) != s.end()) {
    res++;
  }
  dp[n] = res;
  return res;
}
int ar[102];
int b[100007];
map<int, int> mp;
int main() {
  Prime();
  int n;
  n = in<int>();
  int xr = 0;
  for (int i = 1; i < n + 1; i++) {
    ar[i] = in<int>();
  }
  for (int i = 1; i < n + 1; i++) {
    int v = ar[i];
    for (int j = 0; j < ln; j++) {
      int cnt = 0;
      while (v % a[j] == 0) {
        cnt++;
        v /= a[j];
      }
      if (cnt) {
        b[j] |= (1 << (cnt));
      }
    }
    if (v > 1) {
      if (mp.find(v) == mp.end()) xr ^= grundy(2);
      mp[v] = 1;
    }
  }
  for (int i = 0; i < ln; i++) {
    if (b[i]) {
      xr ^= grundy(b[i]);
    }
  }
  if (xr) {
    printf("Mojtaba\n");
  } else {
    printf("Arpa\n");
  }
  return 0;
}
