#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
int n, x, tot = 0, Ans = 0, prime[maxn];
bool isprime[maxn];
map<int, int> sg, st;
void init() {
  memset(isprime, true, sizeof(isprime));
  isprime[1] = false;
  for (int i = 2; i < maxn; i++) {
    if (isprime[i]) prime[++tot] = i;
    for (int j = 1; j <= tot && i * prime[j] < maxn; j++) {
      isprime[i * prime[j]] = false;
      if (i % prime[j] == 0) break;
    }
  }
}
void gao(int x) {
  for (int i = 1; prime[i] * prime[i] <= x; i++) {
    int t = 0;
    while (x % prime[i] == 0) {
      x /= prime[i];
      t++;
    }
    if (t) st[prime[i]] |= 1 << (t - 1);
  }
  if (x != 1) st[x] |= 1;
}
int getsg(int x) {
  if (x == 0) return 0;
  if (sg.count(x)) return sg[x];
  map<int, int> vis;
  int p = x, t = 0;
  while (p) p >>= 1, t++;
  for (int i = 1; i <= t; i++) {
    vis[getsg((x >> i) | (x & ((1 << i - 1) - 1)))] = 1;
  }
  for (int i = 0;; i++)
    if (!vis[i]) return sg[x] = i;
}
int main() {
  init();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &x), gao(x);
  for (map<int, int>::iterator it = st.begin(); it != st.end(); it++)
    Ans ^= getsg(it->second);
  if (Ans)
    puts("Mojtaba");
  else
    puts("Arpa");
  return 0;
}
