#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
const long long MAX = 1e18, OO = 1e16;
bool prime[N];
vector<int> pr;
map<int, int> me;
map<int, int> dp;
int n;
void sieve() {
  memset(prime, true, sizeof(prime));
  for (int i = 2; i * i < N; ++i) {
    if (!prime[i]) continue;
    for (int j = i + i; j < N; j += i) {
      prime[j] = false;
    }
  }
  for (int i = 2; i < N; ++i) {
    if (prime[i]) pr.push_back(i);
  }
}
int MEX(set<int> &s) {
  int cnt = 0;
  while (s.count(cnt)) ++cnt;
  return cnt;
}
int solve(bitset<31> mask) {
  int org = mask.to_ullong();
  if (org == 0) return 0;
  if (dp.find(org) != dp.end()) {
    return dp[org];
  }
  set<int> st;
  int idx = -1;
  for (int i = 30; i >= 0; --i) {
    if (mask[i]) {
      idx = i;
      break;
    }
  }
  for (int shift = 0; shift <= idx; ++shift) {
    bitset<31> bit = mask;
    for (int after = shift; after <= idx; ++after) {
      if (bit[after]) {
        bit[after] = 0;
        if (after - shift - 1 >= 0) bit[after - shift - 1] = 1;
      }
    }
    st.insert(solve(bit));
  }
  return dp[mask.to_ullong()] = MEX(st);
}
int main() {
  sieve();
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    for (int j = 0; j < pr.size(); ++j) {
      int cnt = 0;
      while (x % pr[j] == 0) {
        x /= pr[j];
        ++cnt;
      }
      if (cnt >= 1) me[pr[j]] |= (1 << cnt - 1);
    }
    if (x > 1) me[x] |= (1 << 0);
  }
  int sofar = 0;
  for (auto c : me) {
    sofar ^= solve(c.second);
  }
  if (sofar == 0)
    cout << "Arpa" << endl;
  else
    cout << "Mojtaba" << endl;
}
