#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> p;
map<int, int> dp;
int grundy(int x) {
  if (dp[x]) return dp[x];
  set<int> s;
  for (int i = 1; i <= 30; i++) {
    int a = ((x >> i));
    if (a) s.insert(grundy(a | (x & ((1 << i) - 1))));
  }
  int v = 0;
  while (s.count(v)) {
    v++;
  }
  dp[x] = v;
  return v;
}
int main() {
  std::ios::sync_with_stdio(false);
  ;
  int n;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    std::cin >> x;
    for (int j = 2; j * j <= x; j++) {
      int ctr = 0;
      while (x % j == 0) {
        ctr++;
        x /= j;
      }
      if (ctr) p[j] |= (1 << ctr);
    }
    if (x != 1) {
      p[x] |= (2);
    }
  }
  int ans = 0;
  for (auto it : p) {
    ans ^= (grundy(it.second));
  }
  if (ans)
    std::cout << "Mojtaba" << endl;
  else {
    std::cout << "Arpa" << endl;
  }
  return 0;
}
