#include <bits/stdc++.h>
using namespace std;
bool isp[40000];
vector<int> pl;
map<int, int> nim, gr;
int foo(int st) {
  if (gr.find(st) != gr.end()) return gr[st];
  map<int, char> v;
  for (int i = 1; i < 31; i++) {
    if ((1 << (i - 1)) > st) break;
    int s = st >> i;
    s |= st & ((1 << (i - 1)) - 1);
    v[foo(s)] = true;
  }
  int l = -1;
  bool ok = false;
  for (auto p : v) {
    if (p.first > l + 1) {
      ok = true;
      gr[st] = l + 1;
      break;
    } else
      l = p.first;
  }
  if (!ok) gr[st] = l + 1;
  return gr[st];
}
int main() {
  isp[2] = true;
  for (int i = 3; i < 40000; i += 2) isp[i] = true;
  for (int i = 3; i * i < 40000; i += 2) {
    if (!isp[i]) continue;
    for (int j = i * i; j < 40000; j += i) isp[j] = false;
  }
  pl.push_back(2);
  for (int i = 3; i < 40000; i += 2)
    if (isp[i]) pl.push_back(i);
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    for (int p : pl) {
      if (p > x) break;
      if (x % p) continue;
      int c = 0;
      while (x % p == 0) {
        c++;
        x /= p;
      }
      nim[p] |= 1 << (c - 1);
    }
    if (x > 1) nim[x] |= 1;
  }
  int x = 0;
  gr[0] = 0;
  for (auto p : nim) {
    x ^= foo(p.second);
  }
  puts(x ? "Mojtaba" : "Arpa");
}
