#include <bits/stdc++.h>
using namespace std;
int n, a[103], b[103];
bool sieve[33003];
map<int, int> dp;
vector<int> prime, cons;
int calc(int bit) {
  auto it = dp.find(bit);
  if (it != dp.end()) return it->second;
  int mx = 32 - __builtin_clz(bit);
  vector<int> mex(mx + 1, 0);
  for (int i = 0; i < mx; i++) {
    int nbit = bit;
    for (int j = i; j < mx; j++) {
      if (nbit & (1 << j)) {
        nbit ^= (1 << j);
        if (j > i) nbit |= (1 << (j - i - 1));
      }
    }
    mex[calc(nbit)] = 1;
  }
  for (int i = 0; i <= mx; i++) {
    if (!mex[i]) {
      return dp[bit] = i;
    }
  }
  assert(0);
  return -1;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    b[i] = a[i];
  }
  for (int i = 2; i < 33003; i++) {
    if (sieve[i]) continue;
    prime.push_back(i);
    for (int j = 2; i * j < 33003; j++) {
      sieve[i * j] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    for (auto &p : prime) {
      if (p * p > b[i]) break;
      if (b[i] % p == 0) {
        cons.push_back(p);
        while (b[i] % p == 0) {
          b[i] /= p;
        }
      }
    }
    if (b[i] > 1) cons.push_back(b[i]);
  }
  sort(cons.begin(), cons.end());
  cons.resize(unique(cons.begin(), cons.end()) - cons.begin());
  int grundy = 0;
  dp[0] = 0;
  for (auto &p : cons) {
    int help = 0;
    ;
    for (int i = 0; i < n; i++) {
      int cnt = 0;
      while (a[i] % p == 0) {
        a[i] /= p;
        cnt++;
      }
      if (cnt) help |= (1 << (cnt - 1));
    };
    grundy ^= calc(help);
  }
  puts(grundy ? "Mojtaba" : "Arpa");
  return 0;
}
