#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
int v[SIZE];
int tt;
map<int, int> sg;
int solve(int x) {
  if (sg.count(x)) return sg[x];
  int res = 0, mask = 0, tmp[32] = {};
  for (int i = 0; (1 << i) <= x; i++) {
    tmp[solve((x & mask) | (x >> (i + 1)))] = 1;
    mask |= 1 << i;
  }
  while (tmp[res]) res++;
  return sg[x] = res;
}
int main() {
  sg[0] = 0;
  map<int, int> H;
  int(n);
  scanf("%d", &n);
  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;
        }
        H[j] |= 1 << (cnt - 1);
      }
    }
    if (x != 1) H[x] |= 1;
  }
  int res = 0;
  for (auto it = H.begin(); it != H.end(); it++) {
    res ^= solve(it->second);
  }
  puts(res ? "Mojtaba" : "Arpa");
  return 0;
}
