#include <bits/stdc++.h>
using namespace std;
const int kN = 100 + 10;
int N;
int A[kN];
int primes[1000000], pn;
map<pair<unsigned long long, unsigned long long>, int> SG;
int sol(vector<int> s) {
  if (s.size() == 0) return 0;
  unsigned long long h1 = 0, h2 = 0;
  for (int i = 0; i < s.size(); i++) {
    h1 = h1 * 2333 + s[i];
    h2 = h2 * 233 + s[i];
  }
  pair<unsigned long long, unsigned long long> s_hash = make_pair(h1, h2);
  if (SG.find(s_hash) != SG.end()) return SG[s_hash];
  bool vis[33];
  memset(vis, 0, sizeof(vis));
  for (int k = 1; k <= s.back(); k++) {
    vector<int> new_s;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] > k) {
        new_s.push_back(s[i] - k);
      } else if (s[i] < k) {
        new_s.push_back(s[i]);
      }
    }
    sort(new_s.begin(), new_s.end());
    vis[sol(new_s)] = true;
  }
  for (int i = 0; i < 33; i++)
    if (!vis[i]) {
      SG[s_hash] = i;
      return i;
    }
}
void find_ps(int n) {
  for (int x = 2; x * x <= n; x++) {
    if (n % x == 0) {
      primes[pn++] = x;
      while (n % x == 0) {
        n /= x;
      }
    }
  }
  if (n > 1) primes[pn++] = n;
}
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> A[i];
  for (int i = 1; i <= N; i++) {
    find_ps(A[i]);
  }
  sort(primes, primes + pn);
  int sg = 0, lst = -1;
  for (int i = 0; i < pn; i++) {
    if (primes[i] == lst) continue;
    lst = primes[i];
    vector<int> s;
    for (int j = 1; j <= N; j++) {
      int cnt = 0, tmp = A[j];
      while (tmp % primes[i] == 0) {
        cnt++;
        tmp /= primes[i];
      }
      if (cnt) s.push_back(cnt);
    }
    sort(s.begin(), s.end());
    sg ^= sol(s);
  }
  if (!sg) {
    cout << "Arpa" << endl;
  } else {
    cout << "Mojtaba" << endl;
  }
  return 0;
}
