#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const long long int LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-6;
const int mod = 1000000009;
using namespace std;
map<int, int> num;
map<int, int> memo;
int grundy(int bit) {
  if (bit == 1) return 0;
  if (memo.count(bit)) return memo[bit];
  set<int> conj;
  for (int i = 1; (1 << i) <= bit; i++) {
    conj.insert(grundy((bit >> i) | (bit & (1 << i) - 1)));
  }
  int cur = 0;
  for (auto &obj : conj) {
    if (obj == cur)
      cur++;
    else
      break;
  }
  return memo[bit] = cur;
}
int main() {
  int n;
  cin >> n;
  for (int i = (int)(0); i < (int)(n); ++i) {
    int temp;
    scanf("%d", &temp);
    for (int j = 2; j * j <= temp; j++) {
      int cnt = 0;
      while (temp % j == 0) {
        cnt++;
        temp /= j;
      }
      if (cnt) {
        if (num.count(j) == 0) num[j] = 0;
        num[j] |= (1 << cnt);
      }
    }
    if (temp != 1) num[temp] |= (1 << 1);
  }
  int res = 0;
  for (auto &obj : num) {
    res ^= grundy(obj.second);
    memo.clear();
  }
  if (res)
    puts("Mojtaba");
  else
    puts("Arpa");
  return 0;
}
