P-ON

Time limit: 3s
Memory limit: 512MB
Input:
Output:

After getting bored of playing with the Rubik's Cube and submitting Wrong Answers, Ion decided to move on to more interesting activities. He decided to play a game with his good friend Mario on a one dimensional board which can be represented as an array with nn non-negative integers a1,a2,a3,...,ana_1, a_2, a_3, ... , a_n. The game is played by the following rules:

  • They play the game by moving a pawn on the board which is initially placed at position kk.
  • Ion takes the first move, and they take moves alternatively.
  • In any move with the pawn at position ii, the current player must move the pawn to the \textbf{smallest} next position jj such that j>ij > i and aja_j differs from aia_i on at most one bit in binary representation.
  • The player who can't make any legal move loses the game.

They play this game many times and the board can be modified many times. Ion wants to ask you for some initial states who will win the game.

Input data

The first line of input contains 22 integers nn and mm, 1n,m200 0001 \le n,m \le 200 \ 000, denoting the length of the array and the number of operations.

The second line contains nn integers a1,a2,,ana_1, a_2, \dots , a_n, 0ai2550 \le a_i \le 255, denoting the array aa.

The next mm lines each contains 22 integers opop, 1op21 \le op \le 2 and kk, denoting each operation:

  • op=1op=1 means a modification on the board. Ion will append an integer kk, 0k2550 \le k \le 255 at the end of the array so the array becomes a1,a2,,an+1a_1 , a_2 , \dots , a_{n+1} where nn is the current length of the array before modification.
  • op=2op=2 means a new game starts with the pawn at position kk, 1kn1 \le k \le n, where nn is the current length of the array. You need to predict the winner of this game.

Output data

For each operation with op=2op=2, output one line containing Ion if Ion will win, or Mario if Mario will win.

Constraints and clarifications

  • For 2020 points it is guaranteed that n1 000n \le 1 \ 000 and m1 000m \le 1 \ 000;
  • For the other 8080 points, n200 000n \le 200 \ 000 and m200 000m \le 200 \ 000.

Example

stdin

4 6
7 6 5 4
2 4
1 5
2 4
1 2
2 3
2 2

stdout

Mario
Ion
Mario
Mario

Log in or sign up to be able to send submissions!