#include <bits/stdc++.h>
using namespace std;
map<int, int> m, vis;
void calc(int x) {
  for (int i = 2; i * i <= x; ++i) {
    int cnt = 0;
    while (!(x % i)) x /= i, ++cnt;
    if (cnt) m[i] |= 1 << (cnt - 1);
  }
  if (x > 1) m[x] |= 1;
}
int dfs(int t) {
  if (vis.count(t)) return vis[t];
  int cnt = 0, msk = 0;
  bool temp[40] = {};
  for (int i = 0; (1 << i) <= t; ++i)
    temp[dfs((t & msk) | (t >> (i + 1)))] = 1, msk |= (1 << i);
  while (temp[cnt]) ++cnt;
  return vis[t] = cnt;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (int)1; i <= (int)n; ++i) {
    int x;
    scanf("%d", &x);
    calc(x);
  }
  long long rt = 0;
  for (auto it : m) rt ^= dfs(it.second);
  puts(rt ? "Mojtaba" : "Arpa");
}
