#include <bits/stdc++.h>
using namespace std;
set<pair<long long int, int> > prime;
vector<long long int> Data;
map<int, int> dp;
long long int dfs(long long int x) {
  if (dp.count(x)) return dp[x];
  unordered_set<int> s;
  for (int i = 1; i <= 30; ++i) {
    int y = (x >> i) | (x & ((1 << (i - 1)) - 1));
    if (y != x) s.insert(dfs(y));
  }
  int ans = 0;
  while (s.count(ans)) ++ans;
  return (dp[x] = ans);
}
int main() {
  int n, i, j;
  scanf("%d", &n);
  long long int a[n], p;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 0; i < n; ++i) {
    int cnt = 0, check = 0;
    for (j = 2; j * j <= a[i]; ++j) {
      if (a[i] % j == 0) {
        check = 1;
        p = j;
        while (a[i] % p == 0) {
          a[i] /= p;
          ++cnt;
        }
        prime.insert(make_pair(p, cnt));
        cnt = 0;
      }
    }
    if (a[i] > 1) prime.insert(make_pair(a[i], 1));
  }
  map<long long int, long long int> value;
  set<pair<long long int, int> >::iterator it;
  map<long long int, long long int>::iterator t;
  for (it = prime.begin(); it != prime.end(); ++it)
    value[it->first] |= (1ll << (it->second - 1));
  for (t = value.begin(); t != value.end(); ++t) {
    Data.push_back(t->second);
  }
  dp[0] = 0;
  long long int ans = 0;
  for (i = 0; i < Data.size(); ++i) {
    ans ^= dfs(Data[i]);
  }
  if (ans == 0)
    printf("Arpa");
  else
    printf("Mojtaba");
}
