#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> dp;
int grund(int x) {
  if (dp.count(x)) return dp[x];
  unordered_set<int> s;
  for (int i = 1; i <= 30; ++i) {
    int y = (x >> i) | (x & ((1 << (i - 1)) - 1));
    if (y != x) s.insert(grund(y));
  }
  int ans = 0;
  while (s.count(ans)) ++ans;
  return dp[x] = ans;
}
int solve() {
  map<int, long long> pp;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    for (int p = 2; p * p <= x; ++p) {
      if (x % p == 0) {
        int cn = 0;
        while (x % p == 0) {
          ++cn;
          x /= p;
        }
        pp[p] |= 1 << (cn - 1);
      }
    }
    if (x > 1) pp[x] |= 1;
  }
  dp[0] = 0;
  int ans = 0;
  for (auto e : pp) ans ^= grund(e.second);
  puts(ans ? "Mojtaba" : "Arpa");
  return 0;
}
int main(int argc, char* argv[]) {
  solve();
  return 0;
}
