#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-12;
const int N = 10000 + 10, maxn = 200000 + 10, inf = 0x3f3f3f3f,
          INF = 0x3f3f3f3f3f3f3f3f;
map<int, int> sg, num;
int getsg(int x) {
  if (x == 0) return 0;
  if (sg.count(x)) return sg[x];
  int len = 0, te = x;
  while (te) te /= 2, len++;
  map<int, int> vis;
  for (int i = 1; i <= len; i++)
    vis[getsg((x >> i) | (x & ((1 << (i - 1)) - 1)))] = 1;
  for (int i = 0;; i++)
    if (!vis[i]) return sg[x] = i;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0, x; i < n; i++) {
    scanf("%d", &x);
    for (long long j = 2; j * j <= x; j++) {
      if (x % j == 0) {
        int cnt = 0;
        while (x % j == 0) x /= j, cnt++;
        num[j] |= (1 << (cnt - 1));
      }
    }
    if (x != 1) num[x] |= 1;
  }
  int ans = 0;
  for (auto x : num) ans ^= getsg(x.second);
  if (!ans)
    puts("Arpa");
  else
    puts("Mojtaba");
  return 0;
}
