#include <bits/stdc++.h>
using namespace std;
map<int, int> primes;
void get(int p, int e) { primes[p] |= (1 << e); }
void getPrimes(int n) {
  for (int p = 2; p * p <= n; ++p) {
    if (n % p == 0) {
      int e = 0;
      while (n % p == 0) {
        n /= p;
        ++e;
      }
      get(p, e);
    }
  }
  if (n > 1) get(n, 1);
  return;
}
int mex(set<int> G) {
  int m = 0;
  for (int g : G) {
    if (m == g)
      ++m;
    else
      return m;
  }
  return m;
}
map<int, int> dp;
int grundy(int mask) {
  if (mask == 1) {
    return 0;
  } else if (dp.count(mask)) {
    return dp[mask];
  } else {
    set<int> G;
    int pref = mask & 1;
    int pot = 0;
    while (pref < mask) {
      int new_mask = pref | (mask >> (pot + 1));
      int e = (mask >> (pot + 1)) & 1;
      if (e > 0) pref ^= (1 << (pot + 1));
      G.insert(grundy(new_mask));
      ++pot;
    }
    return dp[mask] = mex(G);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    getPrimes(a);
  }
  int ans = 0;
  for (auto [p, mask] : primes) {
    ans ^= grundy(mask);
  }
  cout << (ans != 0 ? "Mojtaba" : "Arpa") << '\n';
  return 0;
}
