#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
const double error = 1e-7;
const double PI = acos(-1);
mt19937_64 rng(
    (unsigned int)chrono::system_clock::now().time_since_epoch().count());
inline long long int MOD(long long int x, long long int m = mod) {
  long long int y = x % m;
  return (y >= 0) ? y : y + m;
}
const int inf = 1e9 + 5;
const long long int infl = 1e15;
const int nmax = 1e7 + 5;
vector<long long int> primes;
void factor(long long int n) {
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      primes.push_back(i);
      while (n % i == 0) n /= i;
    }
  }
  if (n > 1) primes.push_back(n);
  return;
}
int memo[nmax];
int grundy(int mask) {
  if (mask < nmax && memo[mask] != -1) return memo[mask];
  int g = 0;
  vector<int> reach;
  for (int i = 1; i <= 30; i++) {
    if ((1LL << (i)) > mask) break;
    reach.push_back(grundy((mask & ((1LL << (i)) - 1)) | (mask >> i)));
  }
  sort(reach.begin(), reach.end());
  int ret = 0;
  for (int i = 0; i < reach.size(); i++) {
    if (reach[i] == ret)
      ret++;
    else if (reach[i] > ret)
      break;
  }
  if (mask < nmax) memo[mask] = ret;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  memset(memo, -1, sizeof(memo));
  int n;
  cin >> n;
  vector<int> input(n);
  for (int i = 0; i < n; i++) cin >> input[i];
  for (int i = 0; i < n; i++) factor(input[i]);
  sort(primes.begin(), primes.end());
  primes.resize(unique(primes.begin(), primes.end()) - primes.begin());
  int x = 0;
  for (auto p : primes) {
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      int tmp = 0;
      while (input[i] % p == 0) {
        input[i] /= p;
        tmp++;
      }
      cnt |= (1LL << (tmp));
    }
    x ^= grundy(cnt);
  }
  if (x > 0) {
    cout << "Mojtaba";
  } else {
    cout << "Arpa";
  }
  return 0;
}
