#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 1e5 + 5;
int n;
map<int, int> mp, memo;
int solve(int mask) {
  if (memo.count(mask)) return memo[mask];
  set<int> st;
  for (int k = 1; k <= 30; k++) {
    int nmask = (mask >> k) | (((1 << k) - 1) & mask);
    if (nmask != mask) st.insert(solve(nmask));
  }
  int mex = 0;
  while (st.count(mex)) mex++;
  return memo[mask] = mex;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0, x; i < n; i++) {
    cin >> x;
    for (int j = 2; j * j <= x; j++) {
      int p = 0;
      while (x % j == 0) x /= j, p++;
      if (p) mp[j] |= (1 << p);
    }
    if (x > 1) mp[x] |= 2;
  }
  int xr = 0;
  for (auto &i : mp) xr ^= solve(i.second);
  xr ? cout << "Mojtaba" : cout << "Arpa";
  return 0;
}
