#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:336777216")
using namespace std;
const int MAXN = 100 + 10;
int N;
int a[MAXN];
map<int, long long> Map;
map<long long, int> SG;
int CalcSG(long long i) {
  if (i == 0) return 0;
  if (SG.find(i) != SG.end()) return SG[i];
  int Used[35];
  memset(Used, 0, sizeof(Used));
  for (int k = 1; k < 35; k++) {
    if (i >> (k - 1)) {
      int ne = (i >> k) | (i & ((1LL << (k - 1)) - 1));
      Used[CalcSG(ne)] = 1;
    }
  }
  int sg = 0;
  while (Used[sg]) sg++;
  return SG[i] = sg;
}
void Work() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
    int pnt = a[i];
    for (int p = 2; p * p <= a[i]; p++) {
      int POW = 0;
      while (pnt % p == 0) {
        pnt /= p;
        POW++;
      }
      if (POW) Map[p] = Map[p] | (1LL << (POW - 1));
    }
    if (pnt != 1) Map[pnt] = Map[pnt] | 1;
  }
  int Ans = 0;
  for (auto it : Map) Ans ^= CalcSG(it.second);
  printf(Ans ? "Mojtaba\n" : "Arpa\n");
}
int main() {
  Work();
  return 0;
}
