#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, ar[N];
map<int, int> dp;
int rec(int x) {
  if (dp.count(x)) return dp[x];
  int &ret = dp[x];
  vector<int> v;
  int ub = 0;
  while (1 << ub <= x) ++ub;
  for (int i = 1; i <= ub; ++i) {
    v.push_back(rec((x >> i) | (x & ((1 << (i - 1)) - 1))));
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  for (int i = 0; i < v.size(); ++i)
    if (v[i] != i) return ret = i;
  return ret = v.size();
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int ans = 0;
  dp[0] = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> ar[i];
  for (int i = 2; i < 1e5; ++i) {
    int bm = 0;
    for (int j = 0; j < n; ++j) {
      if (ar[j] % i == 0) {
        int cnt = 0;
        while (ar[j] % i == 0) ar[j] /= i, ++cnt;
        bm |= 1 << (cnt - 1);
      }
    }
    ans ^= rec(bm);
  }
  sort(ar, ar + n);
  ar[n] = 0;
  for (int i = 0; i < n; ++i) {
    if (ar[i] != 1 && ar[i] != ar[i + 1]) ans ^= 1;
  }
  if (ans == 0)
    cout << "Arpa" << endl;
  else
    cout << "Mojtaba" << endl;
  return 0;
}
