#K86762. Zombie Game Winner

    ID: 36937 Type: Default 1000ms 256MiB

Zombie Game Winner

Zombie Game Winner

In this game, Chef and Munchy battle it out in a zombie apocalypse scenario represented by a binary string. Each contiguous block of '1's represents a group of zombies. Chef wins if the number of these contiguous blocks is odd, while Munchy wins if the count is even (including the case when there are no zombies). Formally, if we denote the number of contiguous blocks as \(B\), Chef wins if \(B \equiv 1 \pmod{2}\); otherwise, Munchy wins.

You are given multiple test cases. For each test case, you are provided with the length of the binary string and the binary string itself. Your task is to determine the winner for each test case.

inputFormat

The first line of input contains an integer (T) denoting the number of test cases. Each test case comprises two lines: the first line contains an integer (N) representing the length of the binary string, and the second line contains the binary string consisting only of '0's and '1's.

outputFormat

For each test case, output a single line containing the winner: "CHEF" if Chef wins, otherwise "MUNCHY".## sample

2
3
111
4
1010
CHEF

MUNCHY

</p>