#include <bits/stdc++.h>
using namespace std;
map<int, int> grundy;
int solve(int mask) {
  if (!mask) return 0;
  if (grundy.count(mask)) return grundy[mask];
  int i = 0;
  unordered_set<int> s;
  while (true) {
    if (mask >= (1 << i)) {
      int firstIBits = (mask % (1 << i));
      int lastBits = (mask >> (i + 1));
      int nextMask = firstIBits | lastBits;
      s.insert(solve(nextMask));
    } else {
      break;
    }
    i++;
  }
  int curr = 0;
  while (s.find(curr) != s.end()) curr++;
  return grundy[mask] = curr;
}
int main() {
  int n;
  scanf("%d", &n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    for (int j = 2; j * j <= x; j++) {
      if (x % j == 0) {
        int cnt = 0;
        while (x % j == 0) {
          cnt++;
          x /= j;
        }
        mp[j] = mp[j] | (1 << (cnt - 1));
      }
    }
    if (x > 1) mp[x] = mp[x] | 1;
  }
  int ans = 0;
  map<int, int>::iterator it = mp.begin();
  while (it != mp.end()) {
    ans ^= solve(it->second);
    it++;
  }
  if (!ans)
    printf("Arpa");
  else
    printf("Mojtaba");
  return 0;
}
