#include <bits/stdc++.h>
using namespace std;
void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
}
const int MAX = 1e5 + 2;
bool pr[MAX];
vector<int> primes;
int A[101];
map<int, int> dp;
int grun(int mask) {
  if (mask == 0) return 0;
  if (dp.find(mask) != dp.end()) return dp[mask];
  int mx = 0;
  for (int i = 1; i <= 30; i++)
    if ((mask >> (i - 1)) & 1) mx = i;
  set<int> s;
  for (int i = 1; i <= mx; i++) {
    int newmask = mask >> i;
    int unaffected = mask & ((1 << (i - 1)) - 1);
    newmask = newmask | unaffected;
    s.insert(grun(newmask));
  }
  int ret = 0;
  while (s.find(ret) != s.end()) ret++;
  return (dp[mask] = ret);
}
int main(int argc, char* argv[]) {
  io();
  for (int i = 2; i < MAX; i++) {
    if (pr[i]) continue;
    primes.push_back(i);
    for (int j = i + i; j < MAX; j += i) {
      pr[j] = 1;
    }
  }
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
  }
  int g = 0;
  for (auto p : primes) {
    int msk = 0;
    for (int i = 1; i <= n; i++) {
      int cnt = 0;
      while ((A[i] % p) == 0) {
        cnt++;
        A[i] /= p;
      }
      if (cnt > 0) {
        msk |= (1 << (cnt - 1));
      }
    }
    g ^= grun(msk);
  }
  sort(A + 1, A + n + 1);
  for (int i = 1; i <= n; i++) {
    if (A[i] > 1 && A[i] != A[i - 1]) {
      g ^= 1;
    }
  }
  if (g == 0)
    cout << "Arpa\n";
  else
    cout << "Mojtaba\n";
  return 0;
}
