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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Set;
import java.io.IOException;
import java.util.HashMap;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.StringTokenizer;
import java.util.Map;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        final String first = "Mojtaba";
        final String second = "Arpa";
        Map<State, Integer> cache = new HashMap<>();

        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            Set<Integer> primes = new HashSet<>();
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
                primes.addAll(primeDivisors(a[i]));
            }
            if (false) {
                n = 100;
                a = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = 1 << (i % 31);
                }
                primes.clear();
                primes.add(2);
            }
            int g = 0;
            for (int p : primes) {
                int[] b = new int[n];
                for (int i = 0; i < n; i++) {
                    int x = a[i];
                    while (x % p == 0) {
                        x /= p;
                        ++b[i];
                    }
                }
                g ^= spragueGrundy(new State(b));
            }
            out.println(g != 0 ? first : second);
        }

        private int spragueGrundy(State st) {
            Integer res = cache.get(st);
            if (res != null) {
                return res;
            }
            Set<Integer> was = new HashSet<>();
            int prev = 0;
            for (int i = 0; i < st.a.length; i++) {
                if (i > 0 && st.a[i] == st.a[i - 1]) {
                    continue;
                }
                for (int k = prev + 1; k <= st.a[i]; k++) {
                    int[] na = st.a.clone();
                    for (int j = i; j < st.a.length; j++) {
                        na[j] -= k;
                    }
                    was.add(spragueGrundy(new State(na)));
                }
                prev = st.a[i];
            }
            res = 0;
            while (was.contains(res)) {
                ++res;
            }
            cache.put(st, res);
            return res;
        }

        private List<Integer> primeDivisors(int n) {
            List<Integer> res = new ArrayList<>();
            for (int p = 2; p * p <= n; p++) {
                if (n % p == 0) {
                    res.add(p);
                    while (n % p == 0) {
                        n /= p;
                    }
                }
            }
            if (n > 1) {
                res.add(n);
            }
            return res;
        }

        class State {
            int[] a;

            State(int[] b) {
                int nz = 0;
                for (int i = 0; i < b.length; i++) {
                    if (b[i] != 0) {
                        ++nz;
                    }
                }
                a = new int[nz];
                nz = 0;
                for (int i = 0; i < b.length; i++) {
                    if (b[i] != 0) {
                        a[nz] = b[i];
                        ++nz;
                    }
                }
                Arrays.sort(a);
            }

            public int hashCode() {
                return Arrays.hashCode(a);
            }

            public boolean equals(Object obj) {
                State o = (State) obj;
                return Arrays.equals(a, o.a);
            }

        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

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

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

    }
}

