#include <bits/stdc++.h>
using namespace std;
const long long N = -1;
const long long INF = 1.01e9;
map<long long, int> data;
long long stepMask(long long mask, long long shift) {
  long long low = (mask & ((1ll << (shift)) - 1));
  long long high = mask - low;
  long long nmask = low | (high >> shift);
  return nmask;
}
long long rec(int mask) {
  assert(mask != 0);
  if (mask == 1) {
    return 0;
  }
  if (data.count(mask)) {
    return data[mask];
  }
  long long mex = 0;
  for (long long shift = 1; (1ll << (shift)) <= mask; shift++) {
    long long nmask = stepMask(mask, shift);
    long long res = rec(nmask);
    mex |= (1ll << (res));
  }
  long long res = 0;
  for (; (mex & (1ll << (res))) != 0; res++)
    ;
  data[mask] = res;
  return res;
};
vector<pair<long long, int>> factor(long long x) {
  vector<pair<long long, int>> res;
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      int cnt = 0;
      for (; x % i == 0; x /= i) cnt++;
      res.push_back({i, cnt});
    }
  }
  if (x > 1) res.push_back({x, 1});
  return res;
}
int main() {
  long long n;
  scanf("%lld", &n);
  vector<long long> a(n);
  set<long long> used;
  for (long long i = 0; i < (n); i++) {
    scanf("%lld", &a[i]);
    auto tmp = factor(a[i]);
    for (auto x : tmp) used.insert(x.first);
  }
  long long answer = 0;
  for (auto cand : used) {
    long long mask = 1;
    for (auto x : a) {
      long long cnt = 0;
      for (; x % cand == 0; x /= cand, cnt++)
        ;
      mask |= (1ll << (cnt));
    }
    long long q = rec(mask);
    answer ^= q;
  }
  if (answer == 0) {
    puts("Arpa");
  } else {
    puts("Mojtaba");
  }
  return 0;
}
