#include <bits/stdc++.h>
using namespace std;
template <typename T>
void xchg(T &a, T &b) {
  T c = a;
  a = b;
  b = c;
}
void _main();
int main() {
  _main();
  return 0;
}
map<int, unsigned long long> P;
map<unsigned long long, unsigned long long> SG;
unsigned long long sg(unsigned long long x) {
  if (SG.count(x)) return SG[x];
  bool v[33];
  memset((v), 0, sizeof((v)));
  for (int i = 1; i <= 32; ++i) {
    int t = (x >> i) | (((1 << (i - 1)) - 1) & x);
    if (t == x) break;
    v[sg(t)] = 1;
  }
  for (int i = 0; i < 33; ++i) {
    if (!v[i]) {
      SG[x] = i;
      return i;
    }
  }
  SG[x] = 33;
  return 33;
}
void _main() {
  int N;
  cin >> N;
  while (N--) {
    int x;
    cin >> x;
    for (int p = 2; p * p <= x; ++p) {
      if (x % p) continue;
      x /= p;
      int b = 1;
      while (x % p == 0) {
        b <<= 1;
        x /= p;
      }
      if (P.count(p))
        P[p] |= b;
      else
        P[p] = b;
    }
    if (x > 1) {
      if (P.count(x))
        P[x] |= 1;
      else
        P[x] = 1;
    }
  }
  SG[0] = 0;
  for (int i = 1; i <= 32; ++i) {
    SG[1 << (i - 1)] = i;
  }
  int ans = 0;
  for (const auto &e : P) {
    ans ^= sg(e.second);
  }
  cout << (ans ? "Mojtaba" : "Arpa") << endl;
}
