#include <bits/stdc++.h>
using namespace std;
struct RTC {};
int criba[32000 + 1];
void crearcriba() {
  int w[] = {4, 2, 4, 2, 4, 6, 2, 6};
  for (int p = 25; p <= 32000; p += 10) criba[p] = 5;
  for (int p = 9; p <= 32000; p += 6) criba[p] = 3;
  for (int p = 4; p <= 32000; p += 2) criba[p] = 2;
  for (int p = 7, cur = 0; p * p <= 32000; p += w[cur++ & 7])
    if (!criba[p])
      for (int j = p * p; j <= 32000; j += (p << 1))
        if (!criba[j]) criba[j] = p;
}
vector<long long int> primos;
void buscarprimos() {
  crearcriba();
  for (int i = (2); i < (32000 + 1); i++)
    if (!criba[i]) primos.push_back(i);
}
map<long long int, long long int> fact(long long int n) {
  map<long long int, long long int> ret;
  for (int i = 0; primos[i] * primos[i] <= n; i++) {
    long long int p = primos[i];
    while (n % p == 0) {
      ret[p]++;
      n /= p;
    }
  }
  if (n > 1) ret[n]++;
  return ret;
}
int mex(vector<int> vals) {
  set<int> s((vals).begin(), (vals).end());
  for (int x = 0; x < (((int)(s).size())); x++)
    if (!s.count(x)) return x;
  return ((int)(s).size());
}
map<int, int> mem;
int g(int mask) {
  if (mask == 0) return 0;
  if (mem.count(mask)) return mem[mask];
  vector<int> gs;
  int r = 32 - __builtin_clz(mask);
  for (int k = 1; k < r; k++) {
    int nm = (((mask >> k) | (mask & ((1 << k) - 1))) >> 1) << 1;
    if (nm != mask) gs.push_back(g(nm));
  }
  return (mem[mask] = mex(gs));
}
int main() {
  buscarprimos();
  int n;
  scanf("%d", &n);
  map<int, vector<int> > CNT;
  for (int i = 0; i < (n); i++) {
    int x;
    scanf("%d", &x);
    auto p = fact(x);
    for (auto e : p) {
      int primo = e.first;
      int cnt = e.second;
      CNT[primo].push_back(cnt);
    }
  }
  int ans = 0;
  for (auto e : CNT) {
    int mask = 0;
    for (int k : e.second) mask |= (1 << k);
    ans ^= g(mask);
  }
  if (ans)
    puts("Mojtaba");
  else
    puts("Arpa");
  return 0;
}
