#include <bits/stdc++.h>
using namespace std;
map<int, int> hsh;
set<int> kol[1000000];
int hshidx;
void nadji(int n) {
  int rez = 0;
  for (int i = 2; i * i <= n; ++i) {
    int cnt = 0;
    while (n % i == 0) {
      cnt++;
      n /= i;
    }
    if (cnt != 0) {
      if (hsh[i] == 0) hsh[i] = ++hshidx;
      int hsh1 = hsh[i];
      kol[hsh1].insert(cnt);
    }
  }
  if (n != 1) {
    if (hsh[n] == 0) hsh[n] = ++hshidx;
    int hsh1 = hsh[n];
    kol[hsh1].insert(1);
  }
}
map<int, int> grundy;
int update(int mask, int k) {
  int rez = mask >> k;
  for (int i = 0; i < k; i++) rez |= (mask & (1 << i));
  if (rez & 1) rez ^= 1;
  return rez;
}
int nimber(int a) {
  if (grundy.find(a) != grundy.end()) return grundy[a];
  set<int> mex;
  for (int i = 1; i <= 30; i++) {
    int mask = a;
    mask = update(mask, i);
    if (mask != a) mex.insert(nimber(mask));
  }
  auto it = mex.begin();
  int i = 0;
  for (i = 0; i <= 30 && it != mex.end(); i++) {
    if (*it != i) return grundy[a] = i;
    it++;
  }
  return grundy[a] = i;
}
int main() {
  int rez = 0;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    nadji(x);
  }
  grundy[0] = 0;
  for (int i = 0; i < 1000000; i++) {
    int mask = 0;
    for (auto x : kol[i]) {
      mask |= (1 << x);
    }
    if (mask != 0) rez ^= nimber(mask);
  }
  if (rez != 0)
    printf("Mojtaba");
  else
    printf("Arpa");
  return 0;
}
