#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
const double EPS = 1e-9;
const double PI = acos(-1);
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
map<int, vector<int> > p;
map<long long, int> dp;
long long shift(long long mask, int kam) {
  long long ret = 0;
  for (int i = 0; i < kam; i++)
    if (mask & (1ll << i)) ret |= (1ll << i);
  for (int i = kam; i < 30; i++) {
    if (mask & (1ll << i)) ret |= (1ll << (i - kam));
  }
  return ret;
}
int grundy(long long mask) {
  if (dp.count(mask)) return dp[mask];
  set<int> st;
  for (int i = 1; i < 30; i++) {
    if ((1ll << i) <= mask) st.insert(grundy(shift(mask, i)));
  }
  int ret = 0;
  while (st.count(ret)) ret++;
  return dp[mask] = ret;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    for (int j = 2; j * j <= a; j++) {
      int sum = 0;
      while (a % j == 0) a /= j, sum++;
      if (sum) p[j].push_back(sum);
    }
    if (a > 1) p[a].push_back(1);
  }
  int sum = 0;
  dp[0] = 0;
  dp[1] = 0;
  for (map<int, vector<int> >::iterator it = p.begin(); it != p.end(); it++) {
    long long mask = 0;
    for (int i = 0; i < it->second.size(); i++) {
      mask |= (1ll << (it->second[i]));
    }
    sum ^= grundy(mask);
  }
  if (sum)
    cout << "Mojtaba";
  else
    cout << "Arpa";
  return 0;
}
