#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
map<int, int> sg;
set<int> prime;
void decompose(int x) {
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) {
      if (!prime.count(i)) prime.insert(i);
      while (x % i == 0) x /= i;
    }
  if (x > 1 && !prime.count(x)) prime.insert(x);
}
int n, a[maxn];
int SG(int x) {
  if (sg.count(x)) return sg[x];
  int bit = 0;
  int t = x;
  while (t) {
    bit++;
    t >>= 1;
  }
  bool vis[40];
  memset(vis, false, sizeof(vis));
  for (int k = 1; k < bit; k++) vis[SG((x >> k) | (x & ((1 << k) - 1)))] = true;
  int ans = 0;
  while (vis[ans]) ans++;
  return sg[x] = ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    decompose(a[i]);
  }
  sg[1] = 0;
  int ans = 0;
  for (int p : prime) {
    int mask = 0;
    for (int i = 0; i < n; i++) {
      int cnt = 0;
      while (a[i] % p == 0) {
        cnt++;
        a[i] /= p;
      }
      mask |= (1 << cnt);
    }
    ans ^= SG(mask);
  }
  if (ans)
    printf("Mojtaba\n");
  else
    printf("Arpa\n");
  return 0;
}
