#include <bits/stdc++.h>
using namespace std;
int n, x, ans;
unordered_map<int, long long> f;
unordered_map<int, int> g;
int G(int x) {
  if (g[x]) return g[x];
  unordered_set<int> s;
  for (int i = 0; i <= 29; i++) {
    int y = (x >> (i + 1)) | (x & ((1 << i) - 1));
    if (y >= x) break;
    g[y] = G(y);
    s.insert(g[y]);
  }
  int ans = 0;
  while (s.find(ans) != s.end()) ans++;
  g[x] = ans;
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    for (int p = 2; p * p <= x; ++p) {
      if (x % p == 0) {
        int cn = 0;
        while (x % p == 0) {
          ++cn;
          x /= p;
        }
        f[p] |= 1 << (cn - 1);
      }
    }
    if (x > 1) f[x] |= 1;
  }
  unordered_map<int, long long>::iterator I;
  for (I = f.begin(); I != f.end(); I++) {
    ans ^= G(I->second);
  }
  puts(ans ? "Mojtaba" : "Arpa");
}
