#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 1;
const int MOD = 1e9 + 7;
vector<pair<int, int>> z[101];
map<int, int> M;
int zz;
bool has[6000][31];
int initial[6000];
map<int, int> grundy;
int calc(int msk) {
  if (grundy.count(msk)) return grundy[msk];
  int hh[40] = {};
  for (int i = 1; msk >> i; ++i) {
    int a = (1 << i) - 1;
    hh[calc((a & msk) | (msk >> i))] = true;
  }
  for (int i = 0; i < 40; ++i) {
    if (!hh[i]) {
      grundy[msk] = i;
      return i;
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int a;
    cin >> a;
    long long sqr = sqrt(a);
    for (int j = 2; a != 1 && j <= (sqr + 3); ++j) {
      if (a % j == 0) {
        z[i].push_back({j, 0});
        while (a % j == 0) {
          z[i].back().second++;
          a /= j;
        }
      }
    }
    if (a != 1) {
      z[i].push_back({a, 1});
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (auto it : z[i]) M[it.first];
  }
  for (auto it = M.begin(); it != M.end(); ++it) {
    M[it->first] = zz++;
  }
  for (int i = 1; i <= n; ++i) {
    for (auto it : z[i]) has[M[it.first]][it.second] = true;
  }
  for (int i = 0; i < zz; ++i) {
    for (int j = 1; j < 30; ++j)
      if (has[i][j]) {
        initial[i] ^= (1 << j);
      }
  }
  int ans = 0;
  for (int i = 0; i < zz; ++i) {
    ans ^= calc(initial[i]);
  }
  if (ans == 0) {
    cout << "Arpa";
  } else
    cout << "Mojtaba";
}
