#include <bits/stdc++.h>
using namespace std;
map<int, int> mp, sg;
int grundy(int x) {
  if (sg.find(x) != sg.end()) return sg[x];
  unordered_set<int> vis;
  for (int i = 1; i <= 30; i++) {
    int y = (x >> i) | (x & ((1 << i - 1) - 1));
    if (y != x) vis.insert(grundy(y));
  }
  int res = 0;
  while (vis.find(res) != vis.end()) res++;
  return sg[x] = res;
}
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    for (int j = 2; j * j <= x; j++) {
      if (x % j == 0) {
        int t = 0;
        while (x % j == 0) {
          x /= j;
          ++t;
        }
        mp[j] |= 1 << t - 1;
      }
    }
    if (x > 1) mp[x] |= 1;
  }
  int ans = 0;
  sg[0] = 0;
  for (auto &p : mp) {
    ans ^= grundy(p.second);
  }
  puts(ans ? "Mojtaba" : "Arpa");
  return 0;
}
