#include <bits/stdc++.h>
using namespace std;
map<int, int> dp;
map<int, int> bitmask;
void printBit(int bit) {
  for (int i = 31; i >= 0; --i) {
    if (bit & (1 << i)) {
      cout << 1;
    } else {
      cout << 0;
    }
  }
  cout << endl;
}
int getDp(int bit) {
  if (dp.count(bit)) {
    return dp[bit];
  }
  set<int> s;
  int maxi = 0;
  for (int i = 0; i < 31; ++i) {
    if (bit & (1 << i)) {
      maxi = i;
    }
  }
  int tmp = 0;
  for (int i = 1; i <= maxi; ++i) {
    int u = bit & tmp;
    int nBit = bit ^ u;
    if (nBit & (1 << i)) {
      nBit ^= (1 << i);
    }
    int remBit = u;
    int curBit = nBit >> (i);
    curBit |= remBit;
    s.insert(getDp(curBit));
    tmp += (1 << i);
  }
  for (int i = 0;; ++i) {
    if (!s.count(i)) {
      dp[bit] = i;
      break;
    }
  }
  return dp[bit];
}
void insubunha(int x) {
  int org = 1;
  int u = x;
  for (int i = 2; i * i <= x; ++i) {
    if (x % i == 0) {
      int cc = 0;
      while (x % i == 0) {
        x /= i;
        ++cc;
        org *= i;
      }
      bitmask[i] |= (1 << cc);
    }
  }
  if (x != 1) {
    org *= x;
    bitmask[x] |= (2);
  }
  assert(u == org);
}
void solve() {
  dp[0] = 0;
  int ret = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    insubunha(a);
  }
  for (map<int, int>::iterator it = bitmask.begin(); it != bitmask.end();
       ++it) {
    int b = it->second;
    ret ^= getDp(b);
  }
  if (ret) {
    printf("Mojtaba\n");
  } else {
    printf("Arpa\n");
  }
}
int main() { solve(); }
