#include <bits/stdc++.h>
using namespace std;
int const N = 1e7;
bool isPrime[N];
vector<int> primes;
set<int> p;
int n, A[110];
map<set<int>, int> M;
bool is_prime(int n) {
  if (n < N) return isPrime[n];
  for (int i = 2; i < sqrt(n) + 10; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
void init() {
  isPrime[1] = 0;
  for (int i = 2; i < N; i++) isPrime[i] = 1;
  for (int i = 2; i < N; i++) {
    if (isPrime[i]) {
      primes.push_back(i);
      for (int j = 2; i * j < N; j++) isPrime[i * j] = 0;
    }
  }
}
void factorize(int n) {
  if (is_prime(n)) {
    p.insert(n);
    return;
  }
  int i = 0;
  while (n > 1) {
    if (n % primes[i] == 0) {
      p.insert(primes[i]);
      while (n % primes[i] == 0) n /= primes[i];
      if (n > N) {
        factorize(n);
        return;
      }
    }
    i++;
  }
}
set<int> pile(int prime) {
  set<int> ans;
  for (int i = 0; i < n; i++) {
    int temp = 0;
    while (A[i] % prime == 0) {
      temp++;
      A[i] /= prime;
    }
    if (temp != 0) ans.insert(temp);
  }
  return ans;
}
int mex(set<int> &S) {
  int i = 0;
  while (S.find(i) != S.end()) i++;
  return i;
}
int grundy(set<int> &pile) {
  if (M.find(pile) != M.end()) return M[pile];
  bool loss = 1;
  for (int a : pile)
    if (a != 0) {
      loss = 0;
      break;
    }
  if (loss) return 0;
  set<int> S;
  for (int i = 1; i <= *pile.rbegin(); i++) {
    set<int> v;
    for (int a : pile) {
      if (a >= i)
        v.insert(a - i);
      else
        v.insert(a);
    }
    S.insert(grundy(v));
  }
  return M[pile] = mex(S);
}
bool solve() {
  int x = 0;
  for (int i = 0; i < n; i++) factorize(A[i]);
  for (int prime : p) {
    set<int> v = pile(prime);
    x ^= grundy(v);
  }
  return x != 0;
}
int main() {
  init();
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  bool x = solve();
  if (x)
    cout << "Mojtaba" << endl;
  else
    cout << "Arpa" << endl;
}
