#include <bits/stdc++.h>
using namespace std;
int n, tot = 0, flag = 0, prime[1000000 + 10];
bool is[1000000 + 10];
map<int, int> sg, st;
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;
}
void form() {
  memset(is, true, sizeof(is));
  is[1] = false;
  for (int i = 2; i <= 1000000 + 10 - 5; i++) {
    if (is[i]) prime[++tot] = i;
    for (int j = 1; j <= tot && i * prime[j] <= 1000000 + 10 - 5; j++) {
      is[i * prime[j]] = false;
      if (i % prime[j] == 0) break;
    }
  }
}
void deal(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 main() {
  form();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    deal(x);
  }
  map<int, int>::iterator it;
  for (it = st.begin(); it != st.end(); it++) flag ^= getsg(it->second);
  if (flag)
    printf("Mojtaba\n");
  else
    printf("Arpa\n");
  return 0;
}
