Universal Cup Judging System

Universal Cup

Time Limit: 1.0 s Memory Limit: 1024 MB Total points: 100
Statistics

Menji 博士是一位人工智慧專家。現在,他正在訓練一個 AGI(Artificial Game Intelligence,人工遊戲智慧)— Bot。

為了教導 Bot 如何玩遊戲,他每天都會陪 Bot 玩遊戲。今天他們正在玩以下這個遊戲:

遊戲開始時有一個包含 $2n$ 個非負整數的序列 $a_1, a_2, \cdots, a_{2n}$,以及一個數字 $S$。初始時,$S = 0$。

Menji 和 Bot 輪流行動,由 Menji 先手:

  • 在 Menji 的回合中,他會從序列中選擇一個數字 $x$,將 $S$ 設為 $S \leftarrow S \oplus x$,並從序列中刪除 $x$。請注意,$\oplus$ 為位元互斥或(bitwise XOR)函數。
  • 在 Bot 的回合中,他會從序列中選擇一個數字 $x$,並從序列中刪除 $x$。

當序列中沒有剩餘數字時,遊戲結束。若且唯若最終 $S = 0$ 時 Menji 獲勝;否則 Bot 獲勝。

Menji 想知道,如果雙方都採取最佳策略,誰會是這場遊戲的贏家。

輸入格式

輸入包含多組測試資料。第一行包含一個整數 $T$($1 \le T \le 10^5$),表示測試資料的組數。

對於每組測試資料,第一行包含一個整數 $n$($1 \le n \le 10^5$),其含義如題目所述。

第二行包含 $2n$ 個整數 $a_1, a_2, \cdots, a_{2n}$($0 \le a_i < 2^{30}$),代表遊戲中的整數。

保證所有測試資料中 $n$ 的總和不超過 $2 \times 10^5$。

輸出格式

對於每組測試資料,若 Menji 能贏得遊戲,請在一行中輸出 Menji;否則,請在一行中輸出 Bot。

範例

5
2
1 1 3 3
2
1 1 1 3
3
1 1 4 5 1 4
3
1 9 1 9 8 10
6
1 1 4 5 1 4 1 9 1 9 8 10
Bot
Menji
Menji
Menji
Bot

提示

對於第一組測試資料,無論 Menji 選擇什麼數字,Bot 總是能選擇一個相同的數字,因此 Menji 最終一定會選到一個 $1$ 和一個 $3$,$S = 1 \oplus 3 = 2 \neq 0$,所以 Bot 必定獲勝。

對於第二組測試資料,Menji 可以在第一回合選擇一個 $1$;無論 Bot 選擇什麼,Menji 都可以再選擇另一個 $1$,因此 Menji 總是會拿到兩個 $1$,$S = 1 \oplus 1 = 0$,所以 Menji 必定獲勝。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.