#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
int a[maxn], n;
map<int, int> frc;
map<int, int> divisor(int x) {
  map<int, int> ret;
  ret.clear();
  for (int i = 2; i * i <= x; i++) {
    while (x % i == 0) {
      ret[i]++;
      x /= i;
    }
  }
  if (x != 1) ret[x]++;
  return ret;
}
map<int, int> sts;
map<int, int> grd;
int grundy(int mask) {
  if (mask == 0) return grd[mask] = 0;
  if (grd.find(mask) != grd.end()) return grd[mask];
  int maxbit = 0, tmp = mask;
  while (tmp > 0) {
    tmp >>= 1;
    maxbit++;
  }
  set<int> vis;
  vis.clear();
  for (int i = 1; i <= maxbit; ++i) {
    vis.insert(grundy((mask >> i) | (mask & ((1 << (i - 1)) - 1))));
  }
  int mex = 0;
  while (vis.find(mex) != vis.end()) mex++;
  return grd[mask] = mex;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    frc = divisor(a[i]);
    for (map<int, int>::iterator ite = frc.begin(); ite != frc.end(); ++ite) {
      int k = ite->second;
      sts[ite->first] |= (1 << (k - 1));
    }
  }
  int Ans = 0;
  for (map<int, int>::iterator ite = sts.begin(); ite != sts.end(); ++ite) {
    Ans ^= grundy(ite->second);
  }
  if (Ans == 0)
    printf("Arpa\n");
  else
    printf("Mojtaba\n");
  return 0;
}
