#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const int INF = (int)(1e9 + 1e5);
const long long LINF = (long long)(1e18);
const double EPS = 1e-9;
const int MOD = 1000000007;
const int BASE = 1000003;
const int MAXN = 200;
const int MAX = 1000000000;
int n;
int a[MAXN];
unordered_map<int, set<int> > mapa;
map<set<int>, int> grundi;
int t[MAXN], timer;
int get_val(const set<int>& v) {
  if (v.empty()) {
    return 0;
  }
  auto it = grundi.find(v);
  if (it != grundi.end()) {
    return it->second;
  }
  vector<int> nxt;
  int mx = 0;
  for (auto it = v.begin(); it != v.end(); it++) {
    mx = max(*it, mx);
  }
  for (int i = 1; i <= mx; i++) {
    set<int> to;
    for (auto it = v.begin(); it != v.end(); it++) {
      int val = *it;
      if (val >= i) {
        if (val > i) {
          to.insert(val - i);
        }
      } else {
        to.insert(val);
      }
    }
    nxt.push_back(get_val(to));
  }
  ++timer;
  for (int i = 0; i < (int)nxt.size(); i++) {
    t[nxt[i]] = timer;
  }
  for (int i = 0;; i++) {
    if (t[i] != timer) {
      return grundi[v] = i;
    }
  }
}
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
}
void precalc() {
  const int MAXN = 100;
  const int MAX = 1000000000;
  int last = 0;
  int cnt = 0;
  vector<int> v;
  for (int i = 1; v.size() <= MAXN; i++) {
    bool prime = true;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        prime = false;
        break;
      }
    }
    if (prime) {
      if (v.empty() || MAX / v.back() < i) {
        v.push_back(i);
      } else {
        v.back() *= i;
      }
    }
    ++cnt;
  }
  v.pop_back();
  printf("%d\n", v.size());
  for (int i = 0; i < (int)v.size(); i++) {
    printf("%d ", v[i]);
  }
  printf("\n");
}
void solve() {
  init();
  for (int i = 1; i <= n; i++) {
    int q = a[i];
    for (int j = 2; j * j <= a[i]; j++) {
      if (q % j == 0) {
        int cnt = 0;
        while (q % j == 0) {
          q /= j;
          ++cnt;
        }
        mapa[j].insert(cnt);
      }
    }
    if (q > 1) {
      mapa[q].insert(1);
    }
  }
  int x = 0;
  for (auto it = mapa.begin(); it != mapa.end(); it++) {
    x ^= get_val(it->second);
  }
  if (x) {
    printf("Mojtaba\n");
  } else {
    printf("Arpa\n");
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  srand(333);
  int tests = 1;
  for (int test = 1; test <= tests; test++) {
    solve();
  }
  return 0;
}
