# 解题报告：Codeforces Round #432 (Div. 2) E.Arpa and a game with Mojtaba (博弈)

#include<bits/stdc++.h>

const int N = 1<<20,L=32e3;
#define se second
using namespace std;

vector<int>pr;
int sg[N];
bool Np[L];
map<int,int>M,SG;

inline int work(int x){
if(x<N&&sg[x]>=0)return sg[x];
else if(x>=N&&SG.find(x)!=SG.end())return SG[x];
bool num[35]={0};
int res = 0;
for(int i=1,j=1;j<=x;++i,j<<=1){
int t = (x>>i)|(x&(j-1));
num[work(t)]=1;
}while(num[res])++res;
return x<N?sg[x]=res:SG[x]=res;
}

void init(){
memset(sg,-1,sizeof(sg));
for(int i=1;i<N;++i)sg[i] = work(i);
for(int i=2;i<L;++i){
if(!Np[i])pr.emplace_back(i);
for(int j=0,k=pr[0]*i;k<L;k=pr[++j]*i){
Np[k]=true;
if(i%pr[j]==0)break;
}
}
}

void oper(int x){//printf("in");
int m = sqrt(x+0.5);
for(int i=0;pr[i]<=m&&x>1;++i){
if(x%pr[i]==0){
int t = 1;
while(x%pr[i]==0)t<<=1,x/=pr[i];
t>>=1;
M[pr[i]]|=t;
}
}if(x>1)M[x]|=1;
}

int main()
{
init();
int n,x,ans=0;
scanf("%d",&n);
while(n--){
scanf("%d",&x);
oper(x);
}for(auto it:M){
ans ^= work(it.se);
}printf("%s\n",ans?"Mojtaba":"Arpa");
return 0;
}