#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
map<int, int> M;
int go(int k) {
  if (k == 0) return 0;
  if (M.find(k) != M.end()) return M[k];
  vector<int> v;
  for (int(i) = (1); (i) <= (29); (i) += (1)) {
    if (k >> (i - 1)) {
      int nk = (k & ((1 << (i - 1)) - 1)) | (k >> i);
      v.push_back(go(nk));
    } else
      break;
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  for (int(i) = (0); (i) <= ((int)v.size() - 1); (i) += (1))
    if (v[i] != i) return M[k] = i;
  return M[k] = v.size();
}
int n;
map<int, vector<int> > m;
int main() {
  scanf("%d", &n);
  for (int(i) = (1); (i) <= (n); (i) += (1)) {
    int x;
    scanf("%d", &x);
    for (int j = 2; j * j <= x; j++) {
      if (x % j == 0) {
        int c = 0;
        while (x % j == 0) {
          c++;
          x /= j;
        }
        m[j].push_back(c);
      }
    }
    if (x > 1) m[x].push_back(1);
  }
  int res = 0;
  for (auto it = m.begin(); it != m.end(); it++) {
    auto &v = it->second;
    int t = 0;
    for (auto y : v) t |= (1 << y);
    res ^= go(t >> 1);
  }
  puts(res ? "Mojtaba" : "Arpa");
}
