#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const multiset<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long power(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
map<int, int> m, dp;
int gr(int x) {
  if (x == 1) return 0;
  if (dp.find(x) != dp.end()) return dp[x];
  int grundy = 0, j;
  for (j = 30; j > 0; j--)
    if (x & (1 << j)) break;
  for (int i = 1; i <= j; i++)
    grundy |= (1 << gr((x >> i) | (x & ((1 << i) - 1))));
  if (grundy == 0) return (dp[x] = 0);
  for (int i = 0; i <= 30; i++)
    if (!(grundy & (1 << i))) return (dp[x] = i);
}
int main() {
  int i, j;
  int n;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &j);
    int t = j;
    for (long long k = 2; k * k <= t; k++) {
      int c = 0;
      while (j % k == 0) j /= k, c++;
      if (c > 0) m[k] |= (1 << c);
    }
    if (j > 1) m[j] |= 2;
  }
  int x = 0;
  for (auto u : m) x ^= gr(u.second | 1);
  if (x != 0)
    puts("Mojtaba");
  else
    puts("Arpa");
  return 0;
}
