#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110, WI = 30;
int n, a[MAXN];
map<int, int> sg;
int getsg(int x) {
  if (sg.count(x))
    return sg[x];
  else {
    bool cov[WI];
    memset(cov, 0, sizeof(cov));
    for (int i = 0; i < WI; i++) {
      int y = 0;
      for (int j = 0; j < WI; j++) {
        if (j < i && ((x >> j) & 1)) y |= 1 << j;
        if (j > i && ((x >> j) & 1)) y |= 1 << (j - i - 1);
      }
      if (y != x) cov[getsg(y)] = true;
    }
    int res = 0;
    while (cov[res]) res++;
    sg[x] = res;
    return res;
  }
}
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sg[0] = 0;
}
void solve() {
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j * j <= a[i]; j++) {
      if (a[i] % j == 0) {
        int v = 0;
        for (int k = 1; k <= n; k++) {
          int cnt = -1;
          while (a[k] % j == 0) {
            a[k] /= j;
            cnt++;
          }
          if (cnt >= 0) v |= 1 << cnt;
        }
        ans ^= getsg(v);
      }
    }
    if (a[i] > 1) {
      int j = a[i];
      int v = 0;
      for (int k = 1; k <= n; k++) {
        int cnt = -1;
        while (a[k] % j == 0) {
          a[k] /= j;
          cnt++;
        }
        if (cnt >= 0) v |= 1 << cnt;
      }
      ans ^= getsg(v);
    }
  }
  if (ans)
    printf("Mojtaba\n");
  else
    printf("Arpa\n");
}
int main() {
  init();
  solve();
}
