#include <bits/stdc++.h>
using namespace std;
map<int, int> Mp;
map<int, int> dp;
int go(int msk) {
  if (dp.count(msk)) return dp[msk];
  int &ret = dp[msk];
  set<int> St;
  for (int i = 1; i <= 30; i++) {
    int pv = msk & ((1 << (i - 1)) - 1);
    int nw = msk >> i;
    nw |= pv;
    if (nw != msk) St.insert(go(nw));
  }
  int mn = 0;
  for (auto x : St) {
    if (x != mn) break;
    mn++;
  }
  return ret = mn;
}
int main() {
  int i, j, k, n, x;
  scanf("%d", &n);
  int id = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    int sq = sqrt(x);
    for (j = 2; j <= sq; j++) {
      if (x % j == 0) {
        int cnt = 0;
        while (x % j == 0) {
          x /= j;
          cnt++;
        }
        Mp[j] |= (1 << (cnt - 1));
      }
    }
    if (x > 1) {
      Mp[x] |= 1;
    }
  }
  int xr = 0;
  for (auto x : Mp) {
    xr ^= go(x.second);
  }
  if (!xr)
    printf("Arpa\n");
  else
    printf("Mojtaba\n");
  return 0;
}
