#include <bits/stdc++.h>
using namespace std;
vector<int> w;
map<int, set<int>> pr;
map<vector<int>, int> g;
int gr(vector<int> v) {
  if (v.empty()) return 0;
  if (g.count(v)) return g[v];
  unsigned can = 0, x;
  for (int t = 1; t <= v.back(); ++t) {
    w = {};
    for (int i = 0; i < v.size(); ++i) {
      if (v[i] < t) w.emplace_back(v[i]);
      if (v[i] > t) w.emplace_back(v[i] - t);
    }
    sort(w.begin(), w.end());
    w.erase(unique(w.begin(), w.end()), w.end());
    x = gr(w);
    if (x >= 0 and x <= 29) can |= 1 << x;
  }
  for (x = 0; can >> x & 1; ++x)
    ;
  return g[v] = x;
}
int main() {
  ios::sync_with_stdio(0);
  int n, x;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    int j = 2;
    while (x > 1) {
      if (x % j == 0) {
        int c = 0;
        while (x % j == 0) x /= j, ++c;
        pr[j].insert(c);
      }
      ++j;
      if (1ll * j * j > x) j = x;
    }
  }
  int xs = 0;
  for (auto& i : pr) {
    xs ^= gr(vector<int>(i.second.begin(), i.second.end()));
  }
  if (xs == 0)
    cout << "Arpa\n";
  else
    cout << "Mojtaba\n";
  return 0;
}
