logo AlgoBeat OnlineJudge
登录 注册

#216991. [ICPC 2025 Shanghai R] AGI

内存限制:1024 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Dr. Menji is an expert in AI. Now, he is training Bot, an AGI (Artificial Game Intelligence).

To teach Bot how to play games, he plays with Bot every day. Today they are playing the following game:

The game starts with a sequence of non-negative integers, , and a number . Initially, .

Menji and Bot take turns; Menji goes first:

  • In Menji’s turn, he chooses a number from the sequence, sets , and deletes from the sequence. Note that is the bitwise XOR (exclusive or) function.
  • In Bot’s turn, he chooses a number from the sequence and deletes from the sequence.

The game ends when no numbers remain in the sequence. Menji wins if and only if in the end; otherwise, Bot wins.

Menji wonders if both players play optimally, who is the winner of the game.

输入格式

The input contains multiple testcases. The first line contains an integer (), the number of testcases.

For each testcase, the first line contains an integer (), described in the statement.

The second line contains integers (), representing integers in the game.

It’s guaranteed that the sum of over all testcases does not exceed .

输出格式

For each testcase, if Menji can win the game, print Menji in one line; otherwise, print Bot in one line.

样例

样例输入 1

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

样例输出 1

Bot
Menji
Menji
Menji
Bot

数据范围与提示

For the st testcase, no matter what number Menji chooses, Bot can always choose a same number, so Menji always chooses a and a , , so Bot can always win.

For the nd testcase, Menji can choose a in the first turn; no matter what Bot chooses, Menji can choose another , so Menji always receives two s, , so Menji can always win.