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

public class Solution {


    static MyScanner sc;
    private static PrintWriter out;
    static long M = 1000000007;

    public static void main(String[] s) throws Exception {
//        sc = new MyScanner(new BufferedReader(new StringReader("8\n" +
//                "1 1 1 1 1 1 1 2")));
        sc = new MyScanner(System.in);


        out = new PrintWriter(new OutputStreamWriter(System.out));
        long t = System.currentTimeMillis();
        solve();
    }


    private static void solve() {
        int n = sc.nextInt();
        Map<Integer,  Long> r = new HashMap<>();
        while (n-- > 0) {
            int k = sc.nextInt();
            for (int xx = 2; xx * xx <= k; xx++) {
                int ct = 0;
                while (k % xx == 0) {
                    ct++;
                    k /= xx;
                }
                if (ct > 0) {
                    r.merge(xx, 1L << (ct - 1), (a,b) -> a | b);
                }
            }
            if (k != 1) {
                 r.merge(k, 1L, (a,b) -> a | b);
            }
        }
        int res = 0;
        for (long l : r.values()) {
            res ^= grd(l);
        }
        System.out.println(res == 0 ? "Arpa" : "Mojtaba");
    }

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

    private static int grd(long l) {
        if (l == 0) return 0;
        Integer res = ca.get(l);
        if (res != null) return res;
        Set<Integer> mm = new HashSet<>();
        long mask1 = (1L << 62) - 1;
        long mask2 = 0;
        for (int k = 0 ; l >= (1 << k); k++) {
            long nv1 = l & mask1;
            long nv2 = l & mask2;

            long kk = (nv1 >> (k + 1)) | (nv2);
            mm.add(grd(kk));

            mask1 ^= (1 << k);
            mask2 ^= (1 << k);
        }
        res =  mex(mm);
        ca.put(l, res);
        return res;
    }

    private static int mex(Set<Integer> mm) {
       for (int i = 0  ;; i++) {
            if (!mm.contains(i)) {
                return i;
            }
       }
    }

    private static int[][] tree(int n) {
        int[][] x = new int[2][n - 1];
        for (int i = 0; i < n - 1; i++) {
            x[0][i] = sc.nextInt();
            x[1][i] = sc.nextInt();
        }
        return pn(x, n);
    }

    private static int[][] pn(int[][] x, int n) {
        int[] ct = new int[n];
        int[][] res = new int[n][];
        for (int v : x[0]) {
            ct[v]++;
        }
        for (int v : x[1]) {
            ct[v]++;
        }
        for (int l = 0; l < n; l++) {
            res[l] = new int[ct[l]];
        }
        for (int i = 0; i < x[0].length; i++) {
            res[x[0][i]][--ct[x[0][i]]] = x[1][i];
            res[x[1][i]][--ct[x[1][i]]] = x[0][i];
        }
        return res;
    }


    private static void solveT() {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }


    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextInt();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private static final class STree {
        long[] val1;
        int[] from1;
        int[] to1;
        long[] sum1;

        public STree(int c) {
            int size = Integer.highestOneBit(c - 1);
            size <<= 1;
            size = Math.max(size, 2);
            int rs = size << 1;
            val1 = new long[rs];
            from1 = new int[rs];
            sum1 = new long[rs];
            to1 = new int[rs];

            Arrays.fill(from1, Integer.MAX_VALUE);
            for (int r = rs - 1; r > 1; r--) {
                if (r >= size) {
                    from1[r] = r - size;
                    to1[r] = r - size;
                }
                from1[r / 2] = Math.min(from1[r / 2], from1[r]);
                to1[r / 2] = Math.max(to1[r / 2], to1[r]);
            }
        }

        public void add(int from, int to, long val) {
            add(1, from, to, val);
        }

        private void add(int cur, int from, int to, long val) {
            if (cur >= val1.length) return;
            if (from <= from1[cur] && to1[cur] <= to) {
                val1[cur] += val;
                val1[cur] %= M;
                addToParent(cur, ((long) to1[cur] - from1[cur] + 1) * val);
                return;
            }
            if (from1[cur] > to || from > to1[cur]) {
                return;
            }
            add((cur << 1) + 1, from, to, val);
            add(cur << 1, from, to, val);
        }

        private void addToParent(int cur, long l) {
            l %= M;
            while (cur > 1) {
                sum1[cur] %= M;
                sum1[cur >>= 1] += l;
                sum1[cur] %= M;
            }
        }

        public long sum(int from, int to) {
            return sum(1, from, to);
        }

        private long sum(int cur, int from, int to) {
            if (cur >= val1.length) return 0;
            if (from <= from1[cur] && to1[cur] <= to) {
                return (val1[cur] * (to1[cur] - from1[cur] + 1) + sum1[cur]) % M;
            }
            if (from1[cur] > to || from > to1[cur]) {
                return 0;
            }
            int c1 = Math.max(from, from1[cur]);
            int c2 = Math.min(to, to1[cur]);
            return ((c2 - c1 + 1) * val1[cur] + sum((cur << 1) + 1, from, to) + sum(cur << 1, from, to)) % M;
        }
    }
}