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.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

/*
public class _851E {

}

*/

public class _851E
{
  public void solve() throws FileNotFoundException
  {
    InputStream inputStream = System.in;

    InputHelper inputHelper = new InputHelper(inputStream);

    PrintStream out = System.out;

    // actual solution
    int n = inputHelper.readInteger();

    int[] a = new int[n];

    for (int i = 0; i < n; i++)
    {
      a[i] = inputHelper.readInteger();
    }

    Map<Integer, Integer> ppl = new HashMap<Integer, Integer>();

    for (int i = 0; i < n; i++)
    {
      int num = a[i];

      for (int j = 2; j * j <= num; j++)
      {
        int c = 0;

        while (num % j == 0)
        {
          c++;
          num /= j;
        }

        if (c > 0)
        {
          if (!ppl.containsKey(j))
          {
            ppl.put(j, 0);
          }

          ppl.put(j, ppl.get(j) | (1 << (c - 1)));
        }
      }

      if (num > 1)
      {
        if (!ppl.containsKey(num))
        {
          ppl.put(num, 0);
        }

        ppl.put(num, ppl.get(num) | 1);
      }
    }

    int xor = 0;

    grundy.put(0, 0);

    for (Integer integer : ppl.keySet())
    {
      xor ^= calGrundy(ppl.get(integer));
    }

    if (xor == 0)
    {
      System.out.println("Arpa");
    }
    else
    {
      System.out.println("Mojtaba");
    }
    // end here
  }

  Map<Integer, Integer> grundy = new HashMap<Integer, Integer>();

  int calGrundy(int num)
  {
    Set<Integer> set = new HashSet<Integer>();

    if (grundy.containsKey(num))
    {
      return grundy.get(num);
    }

    for (int i = 1; i <= 30; i++)
    {
      if ((num >> i) == 0 && ((1 << (i - 1)) & num) == 0)
        break;

      int next = (num >> i) | (((1 << (i - 1)) - 1) & num);

      set.add(calGrundy(next));
    }

    for (int i = 0;; i++)
    {
      if (!set.contains(i))
      {
        grundy.put(num, i);
        return i;
      }
    }
  }

  public static void main(String[] args) throws FileNotFoundException
  {
    (new _851E()).solve();
  }

  class InputHelper
  {
    StringTokenizer tokenizer = null;
    private BufferedReader bufferedReader;

    public InputHelper(InputStream inputStream)
    {
      InputStreamReader inputStreamReader = new InputStreamReader(
          inputStream);
      bufferedReader = new BufferedReader(inputStreamReader, 16384);
    }

    public String read()
    {
      while (tokenizer == null || !tokenizer.hasMoreTokens())
      {
        try
        {
          String line = bufferedReader.readLine();
          if (line == null)
          {
            return null;
          }
          tokenizer = new StringTokenizer(line);
        } catch (IOException e)
        {
          e.printStackTrace();
        }
      }

      return tokenizer.nextToken();
    }

    public Integer readInteger()
    {
      return Integer.parseInt(read());
    }

    public Long readLong()
    {
      return Long.parseLong(read());
    }
  }
}
