#include <bits/stdc++.h>
using namespace std;
const int N = 1e9, M = 1e5 + 1, INF = 1e5, mod = 1e9 + 7;
const double PI = 3.141592653589793238462643383279502884197, eps = 1e-15;
int is[M];
vector<int> prms;
map<int, int> dp;
void seive() {
  for (long long i = 2; i * i <= N; i++) {
    if (!is[i]) {
      prms.push_back(i);
      for (long long j = i * i; j * j <= N; j += i) is[j] = 1;
    }
  }
}
int solve(int mask) {
  bool arr[100] = {0};
  int x = 0;
  mask &= ~1;
  int &ret = dp[mask];
  if (ret) return ret - 1;
  for (int i = 1; x < mask; i++) {
    arr[solve((mask >> i) | x)] = 1;
    x |= (mask & (1 << i));
  }
  for (int i = 0; i < 40; i++)
    if (!arr[i]) {
      ret = i + 1;
      break;
    }
  return ret - 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, ans = 0, cnt;
  set<int> nums;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  seive();
  int masks[M] = {0};
  for (int i = 0; i < n; i++) {
    for (unsigned int j = 0; j < prms.size() && prms[j] <= a[i]; j++) {
      cnt = 0;
      while (a[i] % prms[j] == 0) {
        cnt++;
        a[i] /= prms[j];
      }
      masks[j] |= (1 << cnt);
    }
    if (a[i] > 1) nums.insert(a[i]);
  }
  for (unsigned int i = 0; i < prms.size(); i++) {
    dp.clear();
    ans ^= solve(masks[i]);
  }
  cout << (ans ^ (nums.size() % 2) ? "Mojtaba" : "Arpa");
  return 0;
}
