#include <bits/stdc++.h>
using namespace std;
auto scan = [] {
  static long long a;
  scanf("%lld", &a);
  return a;
};
long long A[110];
set<long long> divisibleprime;
map<long long, long long> memo;
long long mex(set<long long>& SS) {
  long long cur = 0;
  for (long long u : SS) {
    if (cur != u) return cur;
    ++cur;
  }
  return cur;
}
long long SG(long long N) {
  if (N == 1) return memo[N] = 0;
  if (memo.count(N)) return memo[N];
  set<long long> tomex;
  for (long long i = 1; N >> i; ++i) {
    tomex.insert(SG(N >> i | (N & ((1 << i) - 1))));
  }
  return memo[N] = mex(tomex);
}
void deal(long long N) {
  long long ON = N;
  for (long long p = 2; p * p <= ON; ++p) {
    if (N % p == 0) divisibleprime.insert(p);
    while (N % p == 0) N /= p;
  }
  if (N != 1) divisibleprime.insert(N);
}
int main() {
  long long n = scan();
  for (int i = 0; i < n; ++i) {
    A[i] = scan();
    deal(A[i]);
  }
  long long SGG = 0;
  for (long long p : divisibleprime) {
    long long toSG = 0;
    for (int i = 0; i < n; ++i) {
      long long k = 0;
      while (A[i] % p == 0) ++k, A[i] /= p;
      toSG |= 1 << k;
    }
    SGG ^= SG(toSG);
  }
  puts(SGG == 0 ? "Arpa" : "Mojtaba");
}
