#include <bits/stdc++.h>
using namespace std;
int sg[1000006], a[1000], ans = 0;
bool vis[30], mark[1000006];
int SG(int x) {
  if (x < 1000006) return sg[x];
  bool vi[30] = {0};
  for (int k = 0; (1 << k) <= x; k++) {
    int y = ((x % (1 << k)) | (x >> (k + 1)));
    vi[SG(y)] = 1;
  }
  for (int i = 0; i < 30; i++) {
    if (vi[i] == 0) return i;
  }
}
int main() {
  for (int i = 1; i < 1000006; i++) {
    for (int k = 0; (1 << k) <= i; k++) {
      int x = ((i % (1 << k)) | (i >> (k + 1)));
      vis[sg[x]] = 1;
    }
    for (int k = 0; k < 30; k++) {
      if (vis[k] == 0) {
        sg[i] = k;
        break;
      }
    }
    memset(vis, 0, sizeof(vis));
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 2; i < 100005; i++) {
    if (mark[i]) continue;
    int x = 0;
    for (int k = i; k < 100005; k += i) mark[k] = 1;
    for (int k = 0; k < n; k++) {
      int cnt = 0;
      while (a[k] % i == 0) {
        a[k] /= i;
        cnt++;
      }
      if (cnt) x |= (1 << (cnt - 1));
    }
    ans ^= SG(x);
  }
  sort(a, a + n);
  int p = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] != p) {
      ans ^= 1, p = a[i];
    }
  }
  if (ans == 0) {
    printf("Arpa\n");
  } else {
    printf("Mojtaba\n");
  }
}
