#include <bits/stdc++.h>
using namespace std;
int n;
map<int, int> m, mem;
void f(int x) {
  for (int i = 2; i * i <= x; i++) {
    int ct = 0;
    while (x % i == 0) x /= i, ct++;
    if (ct) m[i] |= (1 << (ct - 1));
  }
  if (x > 1) m[x] |= (1 << 0);
}
int solve(int x) {
  if (mem.count(x)) return mem[x];
  int ct = 0, msk = 0;
  bool tmp[32];
  memset(tmp, false, sizeof(tmp));
  for (int i = 0; (1 << i) <= x; i++)
    tmp[solve((x & msk) | (x >> (i + 1)))] = true, msk |= (1 << i);
  while (tmp[ct]) ct++;
  return mem[x] = ct;
}
int main() {
  int x;
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> x, f(x);
  long long res = 0;
  for (pair<int, int> v : m) res ^= solve(v.second);
  if (res == 0)
    cout << "Arpa";
  else
    cout << "Mojtaba";
  return 0;
}
