#include <bits/stdc++.h>
using namespace std;
map<int, int> M;
vector<int> X[1003];
map<int, int> dp;
int gG(int mask) {
  if (mask == 0) return 0;
  if (dp.count(mask)) return dp[mask];
  int mex = 0;
  vector<int> V;
  for (int i = 0; i <= 31; i++)
    if (mask & (1 << i)) V.push_back(i);
  for (int i = 1; i <= V[V.size() - 1]; i++) {
    int new_mask = 0;
    for (int j = 0; j < V.size(); j++) {
      if (V[j] < i)
        new_mask |= (1 << V[j]);
      else if (V[j] > i)
        new_mask |= (1 << (V[j] - i));
    }
    mex |= (1 << gG(new_mask));
  }
  V.clear();
  int ans = 0;
  while ((1 << ans) & mex) ans++;
  return dp[mask] = ans;
}
int solve(int p) {
  int mask = 0;
  for (int i = 0; i < X[p].size(); i++) mask |= (1 << X[p][i]);
  return gG(mask);
}
int main() {
  int N;
  cin >> N;
  int p = 0;
  while (N--) {
    int x;
    cin >> x;
    for (int i = 2; i * i <= x; i++) {
      int y = 0;
      while (x % i == 0) x /= i, y++;
      if (y > 0 && M.count(i) == 0) M[i] = ++p;
      if (y > 0) X[M[i]].push_back(y);
    }
    if (x > 1) {
      if (M.count(x) == 0) M[x] = ++p;
      X[M[x]].push_back(1);
    }
  }
  int G = 0;
  for (int i = 1; i <= p; i++) G ^= solve(i);
  if (G == 0)
    cout << "Arpa" << endl;
  else
    cout << "Mojtaba" << endl;
  return 0;
}
