#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 1;
int a[maxn];
set<int> p;
int n;
inline void process(int x) {
  for (int i = 2; i * i <= x; ++i)
    if (x % i == 0) {
      p.insert(i);
      while (x % i == 0) x /= i;
    }
  p.insert(x);
}
map<int, int> d;
inline int sg(int x) {
  if (d.count(x) == 0) {
    int ret = 0;
    set<int> tot;
    for (int j = 1; (x >> j) >= 1; ++j) {
      int nxt = (x >> j) | (x & ((1 << j) - 1));
      tot.insert(sg(nxt));
    }
    for (ret = 0;; ++ret)
      if (!tot.count(ret)) break;
    d[x] = ret;
  }
  return d[x];
}
inline int solve(int x) {
  int tmp = 0;
  for (int i = 0; i < n; ++i) {
    int cnt = 0;
    while (a[i] % x == 0) a[i] /= x, ++cnt;
    tmp |= (1 << cnt);
  }
  return sg(tmp);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 0; i < n; ++i) process(a[i]);
  p.erase(1);
  int ans = 0;
  d[1] = 0;
  for (auto e : p) ans ^= solve(e);
  puts(ans ? "Mojtaba" : "Arpa");
}
