#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 abs(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main(int argc, char const *argv[]) {
  int n, x[n], y[n], z[n];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d %d", &x[i], &y[i], &z[i]);
  }
  for (int i = 0; i < n; i++) {
    int d = abs(z[i] - x[i]), e = abs(z[i] - y[i]);
    if (d < e) {
      printf("Cat A\n");
    } else if (d > e) {
      printf("Cat B\n");
    } else
      printf("Mouse C\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%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,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
lea    0xe52(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    121b <main+0xeb>
mov    -0x50(%rbp),%rcx
mov    -0x58(%rbp),%rdx
mov    -0x60(%rbp),%rsi
movslq -0x3c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x3c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
movslq -0x3c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11c6 <main+0x96>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12ca <main+0x19a>
mov    -0x50(%rbp),%rcx
mov    -0x60(%rbp),%rax
movslq -0x40(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
movslq -0x40(%rbp),%rcx
sub    (%rax,%rcx,4),%edi
call   1030 <abs@plt>
mov    -0x50(%rbp),%rcx
mov    %eax,%edx
mov    -0x58(%rbp),%rax
mov    %edx,-0x44(%rbp)
movslq -0x40(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
movslq -0x40(%rbp),%rcx
sub    (%rax,%rcx,4),%edi
call   1030 <abs@plt>
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    1289 <main+0x159>
lea    0xd8a(%rip),%rdi
call   1040 <printf@plt>
jmp    12b7 <main+0x187>
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
jle    12a6 <main+0x176>
lea    0xd74(%rip),%rdi
call   1040 <printf@plt>
jmp    12b2 <main+0x182>
lea    0xd6a(%rip),%rdi
call   1040 <printf@plt>
jmp    12b7 <main+0x187>
jmp    12bc <main+0x18c>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1222 <main+0xf2>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsp,%r15
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11b6 <main+0x96>
mov    %rsp,%rbx
lea    0xeb1(%rip),%r14
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%r12
movslq 0x4(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r12
jl     1160 <main+0x40>
test   %eax,%eax
jle    11b6 <main+0x96>
xor    %ebx,%ebx
lea    0xe77(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
cmp    %rax,%rbx
jl     11a0 <main+0x80>
mov    %r15,%rsp
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [7 x i8] c"Cat A\0A\00"
@.str.3 = [7 x i8] c"Cat B\0A\00"
@.str.4 = [9 x i8] c"Mouse C\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %6
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %7
%18 = alloca i32, i64 %16
store i64 %16, i64* %8
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = alloca i32, i64 %20
store i64 %20, i64* %9
%22 = load i32, i32* %6
%23 = zext i32 %22 to i64
%24 = alloca i32, i64 %23
store i64 %23, i64* %10
%25 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %11
br label %26
26: ; preds = %41, %2
%27 = load i32, i32* %11
%28 = load i32, i32* %6
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %44
30: ; preds = %26
%31 = load i32, i32* %11
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %18, i64 %32
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %21, i64 %35
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %24, i64 %38
%40 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %33, i32* %36, i32* %39)
br label %41
41: ; preds = %30
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
store i32 %43, i32* %11
br label %26
44: ; preds = %26
store i32 0, i32* %12
br label %45
45: ; preds = %85, %44
%46 = load i32, i32* %12
%47 = load i32, i32* %6
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %88
49: ; preds = %45
%50 = load i32, i32* %12
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %24, i64 %51
%53 = load i32, i32* %52
%54 = load i32, i32* %12
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %18, i64 %55
%57 = load i32, i32* %56
%58 = sub nsw i32 %53, %57
%59 = call i32 @abs(i32 %58)
store i32 %59, i32* %13
%60 = load i32, i32* %12
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i32, i32* %24, i64 %61
%63 = load i32, i32* %62
%64 = load i32, i32* %12
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %21, i64 %65
%67 = load i32, i32* %66
%68 = sub nsw i32 %63, %67
%69 = call i32 @abs(i32 %68)
store i32 %69, i32* %14
%70 = load i32, i32* %13
%71 = load i32, i32* %14
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %75
73: ; preds = %49
%74 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %84
75: ; preds = %49
%76 = load i32, i32* %13
%77 = load i32, i32* %14
%78 = icmp sgt i32 %76, %77
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %83
81: ; preds = %75
%82 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %83
83: ; preds = %81, %79
br label %84
84: ; preds = %83, %73
br label %85
85: ; preds = %84
%86 = load i32, i32* %12
%87 = add nsw i32 %86, 1
store i32 %87, i32* %12
br label %45
88: ; preds = %45
store i32 0, i32* %3
%89 = load i8*, i8** %7
%90 = load i32, i32* %3
ret i32 %90
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@str = [8 x i8] c"Mouse C\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [0 x i32]
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i8* @llvm.stacksave()
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %12, label %22
10: ; preds = %12
%11 = icmp sgt i32 %19, 0
br i1 %11, label %23, label %22
12: ; preds = %2, %12
%13 = phi i64 [ %18, %12 ], [ 0, %2 ]
%14 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 %13
%15 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 %13
%16 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 %13
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %14, i32* %15, i32* %16)
%18 = add nuw nsw i64 %13, 1
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %12, label %10
22: ; preds = %23, %2, %10
ret i32 0
23: ; preds = %10, %23
%24 = phi i64 [ %26, %23 ], [ 0, %10 ]
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%26 = add nuw nsw i64 %24, 1
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = icmp slt i64 %26, %28
br i1 %29, label %23, label %22
}