#include <bits/stdc++.h>
using namespace std;
map<long long, long long> dp;
long long dfs(long long b) {
  if (b == 0) return 0;
  if (dp.count(b)) return dp[b];
  set<long long> s;
  for (long long i = 1; i < 32; i++) {
    long long mk = (1 << (i - 1)) - 1;
    long long nb = b & mk;
    nb |= (b >> i);
    if (nb == b) continue;
    s.insert(dfs(nb));
  }
  long long res = 0;
  while (s.count(res)) res++;
  return dp[b] = res;
}
signed main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    long long t = a[i];
    for (long long j = 2; j < 100000; j++) {
      if (t % j) continue;
      long long k = -1;
      while (t % j == 0) t /= j, k++;
      m[j] |= (1LL << k);
    }
    if (t != 1) m[t] |= 1;
  }
  long long grundy = 0;
  for (auto p : m) {
    grundy ^= dfs(p.second);
  }
  cout << (grundy ? "Mojtaba" : "Arpa") << endl;
  return 0;
}
