#include <bits/stdc++.h>
using namespace std;
map<int, int> dp;
map<int, int> prime;
int solve(int mask) {
  if (dp.count(mask)) return dp[mask];
  int &ret = dp[mask];
  set<int> st;
  for (int i = 1; i <= 30; i++) {
    int nw = 0;
    for (int j = 1; j <= 30; j++) {
      if (j < i && (mask & (1 << j)))
        nw |= (1 << j);
      else if (j > i && (mask & (1 << j)))
        nw |= (1 << (j - i));
    }
    if (nw != mask) st.insert(solve(nw));
  }
  int ans = 0;
  while (st.count(ans)) ans++;
  return ret = ans;
}
int main() {
  int n;
  scanf("%d", &n);
  long long ans = 0;
  int cnt;
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    for (long long j = 2; j * j <= a; j++) {
      if (a % j == 0) {
        cnt = 0;
        while (a % j == 0) {
          cnt++;
          a /= j;
        }
        prime[j] |= (1 << (cnt));
      }
    }
    if (a > 1) prime[a] |= 2;
  }
  for (map<int, int>::iterator it = prime.begin(); it != prime.end(); it++) {
    ans ^= solve(it->second);
  }
  if (ans != 0) {
    puts("Mojtaba");
  } else
    puts("Arpa");
  return 0;
}
