#include <bits/stdc++.h>
using namespace std;
int n, a[110];
vector<int> prime;
bool flag[40010];
int cnt[40010][110];
void init(int MX) {
  for (int i = 2; i <= MX; i++) {
    if (!flag[i]) prime.push_back(i);
    for (int j = 0; j < prime.size() && i * prime[j] <= MX; j++) {
      flag[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
}
int ans = 0;
map<int, int> sg, m;
void dfs(int x) {
  if (sg.count(x)) return;
  bool vis[32];
  memset(vis, 0, sizeof(vis));
  for (int i = 1; x >> (i - 1); i++) {
    int mask = (x >> i) | (x & ((1 << (i - 1)) - 1));
    dfs(mask);
    vis[sg[mask]] = 1;
  }
  for (int i = 0;; i++) {
    if (!vis[i]) {
      sg[x] = i;
      return;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  init(40000);
  for (int j = 0; j < prime.size(); j++) {
    for (int i = 1; i <= n; i++) {
      while (a[i] % prime[j] == 0) {
        a[i] /= prime[j];
        cnt[j][i]++;
      }
      if (cnt[j][i]) m[j] |= (1 << (cnt[j][i] - 1));
    }
  }
  for (int i = 1; i <= n; i++)
    if (a[i] > 1) m[a[i]] |= 1;
  sg[0] = 0;
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) {
    dfs(it->second);
    ans ^= sg[it->second];
  }
  puts(ans ? "Mojtaba" : "Arpa");
  return 0;
}
