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;
long long gcd(long long n1, long long n2) {
  if (n2 == 0) return n1;
  if (n1 % n2 == 0) return n2;
  return gcd(n2, n1 % n2);
}
long long powmod(long long base, long long exponent) {
  if (exponent < 0) exponent += 1000000007LL - 1;
  long long ans = 1;
  while (exponent) {
    if (exponent & 1) ans = (ans * base) % 1000000007LL;
    base = (base * base) % 1000000007LL;
    exponent /= 2;
  }
  return ans;
}
bool cnt[50000][34];
map<int, int> mem;
int f(int x) {
  if (x == 0) return 0;
  if (mem[x]) return mem[x];
  set<int> se;
  for (int i = 1; i <= 30; i++) {
    int mkc = x >> (i - 1);
    if (mkc == 0) break;
    int t = (1 << (i - 1));
    t--;
    t &= x;
    t |= (x >> i);
    se.insert(f(t));
  }
  int res = 0;
  while (!se.empty()) {
    int now = *se.begin();
    se.erase(se.begin());
    if (now != res) break;
    res++;
  }
  mem[x] = res;
  return res;
}
set<int> s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    for (int i = 2; i * i <= 1e9; i++) {
      int cnt1 = 0;
      while (x % i == 0) {
        x /= i;
        cnt1++;
      }
      cnt[i][cnt1] = true;
    }
    if (x > 1) {
      s.insert(x);
    }
  }
  int ans = 0;
  for (int i = 2; i * i <= 1000000000; i++) {
    int now = 0;
    for (int j = 1; j < 30; j++) {
      if (cnt[i][j]) {
        now += (1 << (j - 1));
      }
    }
    if (now != 0) ans ^= f(now);
  }
  int mkc = s.size();
  if (mkc % 2 == 1) ans ^= 1;
  if (ans == 0)
    cout << "Arpa" << '\n';
  else
    cout << "Mojtaba" << '\n';
}
