#include <bits/stdc++.h>
using namespace std;
const int maxl = 100000;
map<int, int> SG, num;
int n, x, tmp, ans = 0, prime[maxl], tot = 0;
bool notprime[maxl + 1];
inline void init() {
  notprime[1] = 1;
  for (int i = 2; i <= maxl; i++) {
    if (!notprime[i]) prime[++tot] = i;
    for (int j = 1; j <= tot && i * prime[j] <= maxl; j++) {
      notprime[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
}
inline int solve(int x) {
  if (x == 0) return 0;
  if (SG.count(x)) return SG[x];
  map<int, int> vis;
  int p = x, t = 0;
  while (p) {
    p /= 2;
    t++;
  }
  for (int i = 1; i <= t; i++)
    vis[solve((x >> i) | (x & ((1 << (i - 1)) - 1)))] = 1;
  for (int i = 0;; i++)
    if (!vis[i]) return SG[x] = i;
}
int main() {
  init();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    for (int pos = 1; prime[pos] * prime[pos] <= x; pos++) {
      tmp = 0;
      while (x % prime[pos] == 0) {
        x /= prime[pos];
        tmp++;
      }
      if (tmp != 0) num[prime[pos]] = num[prime[pos]] | (1 << (tmp - 1));
    }
    if (x != 1) num[x] |= 1;
  }
  for (map<int, int>::iterator it = num.begin(); it != num.end(); it++)
    ans = ans ^ solve(it->second);
  if (ans == 0)
    puts("Arpa");
  else
    puts("Mojtaba");
  return 0;
}
