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.util.*;
import java.io.*;

public class c2 implements Runnable {
    PrintWriter out;
    HashMap<Long, Long> memo;
    long[] tmpArr = new long[45];
    int curId;
    public void main() throws Throwable {
        FastScanner in = new FastScanner(System.in);
        out = new PrintWriter(System.out);
        memo = new HashMap<>();
        /*
        int nn = 100000;
        int[] gs = new int[nn];
        gs[0] = 0;
        for (int i = 1; i < nn; i++) {
            boolean[] has = new boolean[i + 1];
            for (int j = 0; j < 30; j++) {
                if (i < (1 << j)) break;
                int next = ((1 << j) - 1) & i;
                next |= i >>> (j + 1);
                has[gs[next]] = true;
            }
            for (int j = 0; j < has.length; j++) {
                if (!has[j]) {
                    gs[i] = j;
                    break;
                }
            }
            if (gs[i] != grundy(i))
                System.out.printf("g(%2d): %d\n", i, gs[i]);
        }
        System.out.println("hello");
        */
        /*System.out.println(grundy(0b1000000000000000000000000000000));
        System.out.println(grundy(0b1000000011100000001110001100011));
        System.out.println(grundy(0b1111111111111111111111111111111));*/
        int n = in.nextInt();
        long[] arr = new long[n];
        HashMap<Long, Long> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextLong();
            long a = arr[i];
            for (long p = 2; p * p <= a; p++) {
                if (a % p != 0) continue;
                long count = 0;
                while (a % p == 0) {
                    count++;
                    a /= p;
                }
                count = 1L << (count - 1);
                if (map.containsKey(p)) {
                    count |= map.get(p);
                }
                map.put(p, count);
            }
            if (a != 1) {
                long count = 1;
                        long p = a;
                if (map.containsKey(p)) {
                    count |= map.get(p);
                }
                map.put(p, count);
            }
        }
       
        long xor = 0;
        for (long key : map.keySet()) xor ^= grundy(map.get(key));
        
        out.println(xor != 0 ? "Mojtaba" : "Arpa");

        out.close();
    }

    
    public long grundy(long a) {
        if (a <= 2) return a;
        boolean[] tmpArr = new boolean[35];
        Long tmp = memo.get(a);
        if (tmp != null) return tmp;
        for (int j = 0; j < 35; j++) {
            if (a < (1L << j)) break;
            long next = ((1L << j) - 1) & a;
            next |= a >>> (j + 1);
            tmpArr[(int) grundy(next)] = true;
        }
        for (int j = 0; j < 35; j++) {
            if (!tmpArr[j]) {
                memo.put(a, (long) j);
                return j;
            }
        }
        return 0;
    }
    
    
    
    
    
    
    
    
    
    public static void main(String[] args) throws Exception {
        new Thread(null, new c2(), "c", 1L << 29).start();
    }
    public void run() {
        try {
           main(); 
        } catch (Throwable t) {
            t.printStackTrace();
            System.exit(-1);
        }
    }
    static void sort(int[] arr) {
        Random rand = new Random();
        int n = arr.length;
        for (int i = 1; i < n; i++) {
            int j = rand.nextInt(i);
            int tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
        }
        Arrays.sort(arr);
    }
    static void sort(long[] arr) {
        Random rand = new Random();
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = rand.nextInt(i);
            long tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
        }
        Arrays.sort(arr);
    }
    static void sort(double[] arr) {
        Random rand = new Random();
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = rand.nextInt(i);
            double tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
        }
        Arrays.sort(arr);
    }
    static class FastScanner {
        BufferedReader br; StringTokenizer st;
        public FastScanner(InputStream i) {
            br = new BufferedReader(new InputStreamReader(i));
            st = new StringTokenizer("");
        }
        public String next() throws Exception {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }
        public int nextInt() throws Exception {
            return Integer.parseInt(next());
        }
        public double nextDouble() throws Exception {
            return Double.parseDouble(next());
        }
        public long nextLong() throws Exception {
            return Long.parseLong(next());
        }
        public int[] nextIntArr(int n) throws Exception {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) arr[i] = nextInt();
            return arr;
        }
        public double[] nextDoubleArr(int n) throws Exception {
            double[] arr = new double[n];
            for (int i = 0; i < n; i++) arr[i] = nextDouble();
            return arr;
        }
        public long[] nextLongArr(int n) throws Exception {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) arr[i] = nextLong();
            return arr;
        }
        public int[] nextOffsetIntArr(int n) throws Exception {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) arr[i] = nextInt() - 1;
            return arr;
        }
        
        public int[][] nextIntArr(int n, int m) throws Exception {
            int[][] arr = new int[n][m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    arr[i][j] = nextInt();
            return arr;
        }
        public double[][] nextDoubleArr(int n, int m) throws Exception {
            double[][] arr = new double[n][m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    arr[i][j] = nextDouble();
            return arr;
        }
        public long[][] nextLongArr(int n, int m) throws Exception {
            long[][] arr = new long[n][m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    arr[i][j] = nextLong();
            return arr;
        }
    }
}