#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int t, n, k, i;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d", &n, &k);
    int b[k];
    int s = 0, sum = 0;
    for (i = 0; i < k; i++) {
      scanf("%d", &b[i]);
      sum = sum + b[i];
    }
    for (i = 1; i <= n; i++) {
      s = s + i;
    }
    if ((s - sum) % 2 == 0)
      printf("Chef\n");
    if ((s - sum) % 2 != 0)
      printf("Mom\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     126b <main+0x14b>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ef <main+0xcf>
mov    -0x38(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%eax
movslq -0x14(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <main+0x87>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1219 <main+0xf9>
mov    -0x2c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f6 <main+0xd6>
mov    -0x2c(%rbp),%eax
sub    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    123c <main+0x11c>
lea    0xdce(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
sub    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     125f <main+0x13f>
lea    0xdb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
jmp    1141 <main+0x21>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeca(%rip),%rdi
lea    -0x30(%rbp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,-0x30(%rbp)
jae    115a <main+0x3a>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea1(%rip),%r13
jmp    11a5 <main+0x85>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rax),%ecx
add    $0xfffffffe,%eax
imul   %rcx,%rax
shr    %rax
add    $0xffffffff,%eax
sub    %r14d,%eax
test   $0x1,%al
lea    0xe79(%rip),%rdi
lea    0xe76(%rip),%rax
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %r12,%rsp
subl   $0x1,-0x30(%rbp)
jb     1149 <main+0x29>
lea    0xe54(%rip),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,%r12
mov    -0x2c(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
cmpl   $0x0,-0x2c(%rbp)
mov    $0x0,%r14d
jle    1211 <main+0xf1>
xor    %r15d,%r15d
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    (%rbx),%r14d
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r15
jl     11f0 <main+0xd0>
mov    -0x34(%rbp),%eax
test   %eax,%eax
jg     1170 <main+0x50>
xor    %eax,%eax
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [6 x i8] c"Chef\0A\00"
@.str.3 = [5 x i8] c"Mom\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %11
11: ; preds = %67, %0
%12 = load i32, i32* %2
%13 = add nsw i32 %12, -1
store i32 %13, i32* %2
%14 = icmp ne i32 %12, 0
br i1 %14, label %15, label %69
15: ; preds = %11
%16 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%17 = load i32, i32* %4
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %6
%20 = alloca i32, i64 %18
store i64 %18, i64* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %5
br label %21
21: ; preds = %36, %15
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %39
25: ; preds = %21
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %20, i64 %27
%29 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %28)
%30 = load i32, i32* %9
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %20, i64 %32
%34 = load i32, i32* %33
%35 = add nsw i32 %30, %34
store i32 %35, i32* %9
br label %36
36: ; preds = %25
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %21
39: ; preds = %21
store i32 1, i32* %5
br label %40
40: ; preds = %48, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %3
%43 = icmp sle i32 %41, %42
br i1 %43, label %44, label %51
44: ; preds = %40
%45 = load i32, i32* %8
%46 = load i32, i32* %5
%47 = add nsw i32 %45, %46
store i32 %47, i32* %8
br label %48
48: ; preds = %44
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %40
51: ; preds = %40
%52 = load i32, i32* %8
%53 = load i32, i32* %9
%54 = sub nsw i32 %52, %53
%55 = srem i32 %54, 2
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %51
%58 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %59
59: ; preds = %57, %51
%60 = load i32, i32* %8
%61 = load i32, i32* %9
%62 = sub nsw i32 %60, %61
%63 = srem i32 %62, 2
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %59
%66 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %67
67: ; preds = %65, %59
%68 = load i8*, i8** %6
br label %11
69: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d%d\00"
@str = [4 x i8] c"Mom\00"
@str.4 = [5 x i8] c"Chef\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp eq i32 %8, 0
br i1 %10, label %53, label %11
11: ; preds = %0, %43
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
%16 = alloca i32, i64 %14
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 0
br i1 %18, label %32, label %19
19: ; preds = %32, %11
%20 = phi i32 [ 0, %11 ], [ %38, %32 ]
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 1
br i1 %22, label %43, label %23
23: ; preds = %19
%24 = add nsw i32 %21, -1
%25 = zext i32 %24 to i33
%26 = add nsw i32 %21, -2
%27 = zext i32 %26 to i33
%28 = mul i33 %25, %27
%29 = lshr i33 %28, 1
%30 = trunc i33 %29 to i32
%31 = add i32 %30, -1
br label %43
32: ; preds = %11, %32
%33 = phi i64 [ %39, %32 ], [ 0, %11 ]
%34 = phi i32 [ %38, %32 ], [ 0, %11 ]
%35 = getelementptr inbounds i32, i32* %16, i64 %33
%36 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %35)
%37 = load i32, i32* %35
%38 = add nsw i32 %37, %34
%39 = add nuw nsw i64 %33, 1
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = icmp slt i64 %39, %41
br i1 %42, label %32, label %19
43: ; preds = %23, %19
%44 = phi i32 [ 0, %19 ], [ %31, %23 ]
%45 = sub i32 %44, %20
%46 = and i32 %45, 1
%47 = icmp eq i32 %46, 0
%48 = select i1 %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0)
%49 = call i32 @puts(i8* dereferenceable(1) %48)
%50 = load i32, i32* %1
%51 = add nsw i32 %50, -1
store i32 %51, i32* %1
%52 = icmp eq i32 %50, 0
br i1 %52, label %53, label %11
53: ; preds = %43, %0
ret i32 0
}