#include <bits/stdc++.h>
using namespace std;
map<int, int> mp, pw;
int grundy(int mask) {
  if (mp.count(mask)) return mp[mask];
  unordered_set<int> s;
  for (int i = 1; i < 30; i++) {
    int msk = (mask >> i) | (mask & ((1 << (i - 1)) - 1));
    if (msk != mask) s.insert(grundy(msk));
  }
  int ans = 0;
  while (s.count(ans)) ans++;
  mp[mask] = ans;
  return ans;
}
void solve() {
  int n;
  cin >> n;
  for (int i = 1, x; i <= n; i++) {
    cin >> x;
    for (int j = 2; j * j <= x; j++) {
      int cnt = 0;
      while (x % j == 0) x /= j, cnt++;
      if (cnt) pw[j] |= (1 << (cnt - 1));
    }
    if (x > 1) pw[x] |= 1;
  }
  int ans = 0;
  mp[0] = 0;
  for (auto tp : pw) ans ^= grundy(tp.second);
  if (ans)
    cout << "Mojtaba";
  else
    cout << "Arpa";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
