#include <bits/stdc++.h>
using namespace std;
int shortenAndGetPower(int divider, int &x) {
  int power = 0;
  while (0 == x % divider) {
    x /= divider;
    ++power;
  }
  return power;
}
list<pair<int, int> > factorize(int x) {
  list<pair<int, int> > factorization;
  if (0 == x % 2) {
    factorization.emplace_back(2, shortenAndGetPower(2, x));
  }
  for (int divider = 3; 1LL * divider * divider <= x; divider += 2) {
    if (0 == x % divider) {
      factorization.emplace_back(divider, shortenAndGetPower(divider, x));
    }
  }
  if (1 < x) {
    factorization.emplace_back(x, 1);
  }
  return factorization;
}
map<vector<int>, long long> spragueGrundyMemory;
long long calculateSpragueGrundy(vector<int> powers) {
  sort(powers.begin(), powers.end());
  if (spragueGrundyMemory.count(powers)) {
    return spragueGrundyMemory[powers];
  }
  set<long long> spragueGrundy;
  for (int power = 1; power <= powers.back(); ++power) {
    vector<int> newPowers;
    for (int i = 0; i < (int)powers.size(); ++i) {
      if (powers[i] != power) {
        newPowers.push_back(powers[i] < power ? powers[i] : powers[i] - power);
      }
    }
    spragueGrundy.insert(calculateSpragueGrundy(newPowers));
  }
  long long mex;
  for (mex = 0; spragueGrundy.count(mex); ++mex)
    ;
  return spragueGrundyMemory[powers] = mex;
}
bool isMojtaba(int n, int a[]) {
  map<int, vector<int> > primeToPowers;
  for (int i = 0; i < n; ++i) {
    const auto primePowers = factorize(a[i]);
    for (const auto &primePower : primePowers) {
      primeToPowers[primePower.first].push_back(primePower.second);
    }
  }
  spragueGrundyMemory.clear();
  spragueGrundyMemory[vector<int>()] = 0;
  long long spragueGrundy = 0;
  for (const auto &primePowers : primeToPowers) {
    spragueGrundy ^= calculateSpragueGrundy(primePowers.second);
  }
  return spragueGrundy > 0;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int a[n];
    for (int i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
    }
    if (isMojtaba(n, a)) {
      printf("Mojtaba\n");
    } else {
      printf("Arpa\n");
    }
  }
  return 0;
}
