#include <bits/stdc++.h>
using namespace std;
template <int n>
using AI = array<int, n>;
const double eps = 1e-9;
const int oo = 0x3F3F3F3F;
const long long ooLL = 0x3F3F3F3F3F3F3F3FLL;
const int MOD = 1000000007;
template <typename T>
T sqr(T x) {
  return x * x;
}
const double PI = acos(-1.);
long long Round(double x) { return x < 0 ? x - .5 : x + .5; }
int main() {
  void run();
  run();
  return 0;
}
int n, a[111];
map<int, int> g;
int gt(int m) {
  if (g.count(m)) return g[m];
  int &rs = g[m];
  rs = 0;
  if (!m) return rs;
  set<int> ng;
  for (int k = 0; (1 << k) <= m; ++k) {
    int np = m >> (k + 1), pp = m & ((1 << k) - 1);
    ng.insert(gt(np | pp));
  }
  while (ng.count(rs)) ++rs;
  return rs;
}
void run() {
  scanf("%d", &n);
  for (int i = (0), _b(n); i < _b; ++i) scanf("%d", a + i);
  map<int, int> ps;
  for (int i = (0), _b(n); i < _b; ++i) {
    for (int j = 2; j * j <= a[i]; ++j) {
      int k = 0;
      while (a[i] % j == 0) a[i] /= j, ++k;
      if (k) ps[j] |= 1 << (k - 1);
    }
    if (a[i] > 1) ps[a[i]] |= 1;
  }
  int rs = 0;
  for (auto &p : ps) rs ^= gt(p.second);
  puts(rs ? "Mojtaba" : "Arpa");
}
