#include <bits/stdc++.h>
using namespace std;
int n;
int sg[1 << 20];
bool have[30];
bool isprime[100000];
vector<int> prime;
void init() {
  sg[0] = 0;
  sg[1] = 0;
  for (int i = 2; i < (1 << 20); i++) {
    fill(have, have + 30, false);
    for (int j = 1; j < 20; j++) {
      if (i < (1 << j)) break;
      int next = i;
      int tmp = i >> j;
      int tmp2 = tmp << j;
      next ^= tmp2;
      next |= tmp;
      have[sg[next]] = true;
    }
    for (int j = 0; j < 30; j++) {
      if (!have[j]) {
        sg[i] = j;
        break;
      }
    }
  }
  fill(isprime, isprime + 100000, true);
  isprime[1] = false;
  isprime[0] = false;
  for (int i = 2; i < 100000; i++) {
    if (!isprime[i]) continue;
    prime.push_back(i);
    for (int j = 2; i * j < 100000; j++) {
      isprime[i * j] = false;
    }
  }
}
int get(int x) {
  if (x < (1 << 20)) return sg[x];
  long long h = 0;
  for (int j = 1; j <= 30; j++) {
    if (x < (1 << j)) break;
    int next = x;
    int tmp = x >> j;
    int tmp2 = tmp << j;
    next ^= tmp2;
    next |= tmp;
    int k = get(next);
    h |= 1ll << k;
  }
  for (int j = 0; j < 64; j++) {
    if (!(h & (1ll << j))) {
      return j;
    }
  }
  return -1;
}
int a[110];
unordered_set<int> ps;
int main() {
  init();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  for (int i = 0; i < n; i++) {
    int x = a[i];
    for (auto p : prime) {
      while (x % p == 0) {
        x /= p;
        ps.insert(p);
      }
    }
    if (x != 1) ps.insert(x);
  }
  int sgsum = 0;
  for (auto p : ps) {
    int k = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] % p == 0) {
        int x = a[i];
        int cnt = 0;
        while (x % p == 0) {
          x /= p;
          cnt++;
        }
        k |= (1 << cnt);
      }
    }
    sgsum ^= get(k);
  }
  if (sgsum == 0)
    printf("Arpa\n");
  else
    printf("Mojtaba");
}
