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 MOD = 1000000007;
const int UNDEF = -1;
const long long INF = 1e18;
template <typename T>
inline bool chkmax(T &aa, T bb) {
  return aa < bb ? aa = bb, true : false;
}
template <typename T>
inline bool chkmin(T &aa, T bb) {
  return aa > bb ? aa = bb, true : false;
}
int rint();
char rch();
long long rlong();
const int MAXN = 1e6;
const int MAXP = MAXN;
bool sieve_array[MAXP + 1];
int ap[MAXP + 1];
vector<int> gpv;
void sieve() {
  for (int i = 0; i <= MAXP; i++) {
    sieve_array[i] = true;
    ap[i] = 1 << 30;
  }
  sieve_array[0] = false;
  sieve_array[1] = false;
  int lim = (int)(ceil(sqrt(MAXP))) + 2;
  for (int i = 2; i <= lim; i++) {
    if (sieve_array[i]) {
      for (int j = i * i; j <= MAXP; j += i) {
        sieve_array[j] = false;
        ap[j] = i;
      }
    }
  }
  for (int i = 2; i <= MAXP; i++) {
    if (sieve_array[i]) {
      gpv.push_back(i);
      ap[i] = i;
    }
  }
}
pair<int, int> factorize_dest[500];
int factorize_tmp[500];
int factorize(int x) {
  int power = 1;
  int tsz = 0;
  while (x >= MAXP) {
    bool found = false;
    for (auto &p : gpv) {
      if (p * (long long)p > x) break;
      while ((x % p) == 0) {
        x /= p;
        factorize_tmp[tsz++] = p;
        found = true;
      }
    }
    if (x < MAXP) break;
    if (!found) break;
  }
  if (x < MAXP) {
    while (x > 1) {
      int p = ap[x];
      x /= p;
      factorize_tmp[tsz++] = p;
    }
  }
  if (x > 1) factorize_tmp[tsz++] = x;
  sort(factorize_tmp, factorize_tmp + tsz);
  int didx = 0;
  for (int tidx = 0; tidx < tsz; tidx++) {
    int p = factorize_tmp[tidx];
    if (tidx == 0 || p != factorize_tmp[tidx - 1]) {
      factorize_dest[didx++] = make_pair(p, power);
    } else
      factorize_dest[didx - 1].second += power;
  }
  return didx;
}
char mex(vector<char> &v) {
  sort(v.begin(), v.end());
  char ans = 0;
  for (auto &w : v) {
    if (w == ans) ans++;
  }
  return ans;
}
int ilog2(int x) { return 31 - __builtin_clz(x); }
const int mz = 128 << 20;
char dp[mz];
char nim(int z) {
  if (z < mz && dp[z] != -1) return dp[z];
  vector<char> v;
  bool can = 0;
  for (int x = ilog2(z); x >= 0; x--) {
    int msk = 1 << x;
    if (z & msk) can = true;
    if (can) {
      int nz = (z & (msk - 1)) | (z >> (x + 1));
      v.push_back(nim(nz));
    }
  }
  char ans = mex(v);
  if (z < mz) dp[z] = ans;
  return ans;
}
int main() {
  memset(dp, -1, sizeof dp);
  dp[0] = 0;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  sieve();
  int n = rint();
  map<int, int> h;
  for (int i = 0; i < n; i++) {
    int x = rint();
    int fsz = factorize(x);
    for (int j = 0; j < fsz; j++) {
      int p = factorize_dest[j].first;
      int e = factorize_dest[j].second;
      assert(e >= 1);
      h[p] |= 1 << (e - 1);
    }
  }
  int sum = 0;
  for (auto &w : h) {
    int nimed = nim(w.second);
    sum ^= nimed;
  }
  if (sum != 0)
    printf("Mojtaba\n");
  else
    printf("Arpa\n");
}
static char stdinBuffer[1024];
static char *stdinDataEnd = stdinBuffer + sizeof(stdinBuffer);
static const char *stdinPos = stdinDataEnd;
void readAhead(size_t amount) {
  size_t remaining = stdinDataEnd - stdinPos;
  if (remaining < amount) {
    memmove(stdinBuffer, stdinPos, remaining);
    size_t sz = fread(stdinBuffer + remaining, 1,
                      sizeof(stdinBuffer) - remaining, stdin);
    stdinPos = stdinBuffer;
    stdinDataEnd = stdinBuffer + remaining + sz;
    if (stdinDataEnd != stdinBuffer + sizeof(stdinBuffer)) *stdinDataEnd = 0;
  }
}
int rint() {
  readAhead(16);
  int x = 0;
  bool neg = false;
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  if (*stdinPos == '-') {
    ++stdinPos;
    neg = true;
  }
  while (*stdinPos >= '0' && *stdinPos <= '9') {
    x *= 10;
    x += *stdinPos - '0';
    ++stdinPos;
  }
  return neg ? -x : x;
}
char rch() {
  readAhead(16);
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  char ans = *stdinPos;
  ++stdinPos;
  return ans;
}
long long rlong() {
  readAhead(32);
  long long x = 0;
  bool neg = false;
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  if (*stdinPos == '-') {
    ++stdinPos;
    neg = true;
  }
  while (*stdinPos >= '0' && *stdinPos <= '9') {
    x *= 10;
    x += *stdinPos - '0';
    ++stdinPos;
  }
  return neg ? -x : x;
}
