#include <bits/stdc++.h>
using namespace std;
int n, cnt;
struct node {
  int x, y;
} a[8000009];
struct hsh {
  int tot, fst[20000003], pnt[8000009], len[8000009], nxt[8000009];
  void ins(int x, int y) {
    int z = x % 20000003;
    pnt[++tot] = x;
    len[tot] = y;
    nxt[tot] = fst[z];
    fst[z] = tot;
  }
  int calc(int x) {
    int i, z = x % 20000003;
    for (i = fst[z]; i; i = nxt[i])
      if (pnt[i] == x) return len[i];
    return -1;
  }
} sg;
bool cmp(node u, node v) { return u.x < v.x; }
int dp(int x) {
  int tmp = sg.calc(x);
  if (tmp != -1) return tmp;
  int i;
  bool vis[33];
  memset(vis, 0, sizeof(vis));
  for (i = 1; x >> i; i++) vis[dp(x >> i | x & (1 << i) - 1)] = 1;
  for (i = 0; vis[i]; i++)
    ;
  sg.ins(x, i);
  return i;
}
int main() {
  scanf("%d", &n);
  int i, j, x;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    for (j = 2; j * j <= x; j++)
      if (!(x % j)) {
        a[++cnt].x = j;
        for (; !(x % j); x /= j) a[cnt].y++;
      }
    if (x > 1) {
      a[++cnt].x = x;
      a[cnt].y = 1;
    }
  }
  sort(a + 1, a + cnt + 1, cmp);
  int ans = 0;
  for (i = j = 1; i <= cnt; i = j) {
    int tmp = 0, now = 0;
    for (; j <= cnt && a[i].x == a[j].x; j++) {
      tmp++;
      now |= 1 << a[j].y;
    }
    if (tmp < n) now |= 1;
    ans ^= dp(now);
  }
  puts((ans > 0) ? "Mojtaba" : "Arpa");
  return 0;
}
