Mojtaba and Arpa are playing a game. They have a list of n numbers in the game.

In a player's turn, he chooses a number pk (where p is a prime number and k is a positive integer) such that pk divides at least one number in the list. For each number in the list divisible by pk, call it x, the player will delete x and add <image> to the list. The player who can not make a valid choice of p and k loses.

Mojtaba starts the game and the players alternatively make moves. Determine which one of players will be the winner if both players play optimally.

Input

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of elements in the list.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the elements of the list.

Output

If Mojtaba wins, print "Mojtaba", otherwise print "Arpa" (without quotes).

You can print each letter in any case (upper or lower).

Examples

Input

4
1 1 1 1


Output

Arpa


Input

4
1 1 17 17


Output

Mojtaba


Input

4
1 1 17 289


Output

Arpa


Input

5
1 2 3 4 5


Output

Arpa

Note

In the first sample test, Mojtaba can't move.

In the second sample test, Mojtaba chooses p = 17 and k = 1, then the list changes to [1, 1, 1, 1].

In the third sample test, if Mojtaba chooses p = 17 and k = 1, then Arpa chooses p = 17 and k = 1 and wins, if Mojtaba chooses p = 17 and k = 2, then Arpa chooses p = 17 and k = 1 and wins.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;


public class Main {
    static final Scanner in = new Scanner(System.in);
    static final int MAXN = 100 + 10;
    static final int MAXP = (int) Math.sqrt(1e9+10);
    static final List<Integer> primes = new Primes(MAXP).getPrimes();

    static int N;
    static Map<Integer, Integer> f = new HashMap<>();
    static int[] pow2 = new int[32];

    public static void main(String[] args) {
        for(int i=0; i < 31; ++i) pow2[i] = 1 << i;

        N = in.nextInt();
        for(int i=0; i < N; ++i) {
            int a = in.nextInt();
            for(int e: primes) {
                if( a < e ) break;
                if( a % e != 0 ) continue;
                int cnt = 0;
                for(a/=e; a%e == 0; a/=e) ++cnt;
                Integer target = f.get(e);
                if( target == null ) target = 0;
                f.put(e, target | (1<<cnt));
            }
            if( a > 1 ) f.put(a, 1);
        }

        if( firstWin() ) System.out.println("Mojtaba");
        else System.out.println("Arpa");
    }

    static Map<Integer, Integer> sg = new HashMap<>();

    static int calSG(int S) {
        Integer ans = sg.get(S);
        if( ans != null ) return ans;
        ans = 0;

        Set<Integer> mex = new TreeSet<>();
        for(int i=0; i < 30 && pow2[i] <= S; ++i) {
            int T = (S >> (i+1)) | ((pow2[i]-1) & S);
            mex.add(calSG(T));
        }

        for(int s: mex) {
            if( s != ans ) break;
            ++ans;
        }

        sg.put(S, ans);
        return ans;
    }

    static boolean firstWin() {
        int ans = 0;
        for(int target: f.values()) ans ^= calSG(target);
        return ans != 0;
    }
}

class Primes {
    final int MAXN;
    boolean[] isNotPrime;
    List<Integer> primes;

    public Primes(int MAXN) {
        this.MAXN = MAXN;
        isNotPrime = new boolean[MAXN];
        primes = new ArrayList<>();

        init();
    }

    public List<Integer> getPrimes() {
        return primes;
    }

    protected void init() {
        for(int i=2; i < MAXN; ++i) {
            if( !isNotPrime[i] ) primes.add(i);
            for(int e: primes) {
                int x = e * i;
                if( x >= MAXN ) break;
                isNotPrime[x] = true;
                if( i % e == 0 ) break;
            }
        }
    }
}

class Scanner {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public Scanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in), 32768);
        tokenizer = null;
    }

    public Scanner(InputStream in, int size) {
        reader = new BufferedReader(new InputStreamReader(in), size);
        tokenizer = null;
    }

    public boolean hasNext() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e) {
                return false;
            }
        }
        return true;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}