#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 i, j, c, len, ng, nm, temp, t, res, gmax, mmax;
  scanf("%d", &t);
  while (t--) {
    mmax = gmax = -1;
    scanf("%d %d", &ng, &nm);
    if (ng == 0 && nm == 0)
      printf("uncertain\n");
    for (i = 0; i < ng; i++) {
      scanf("%d", &temp);
      gmax = ((gmax) > (temp) ? (gmax) : (temp));
    }
    for (i = 0; i < nm; i++) {
      scanf("%d", &temp);
      mmax = ((mmax) > (temp) ? (mmax) : (temp));
    }
    if (gmax >= mmax)
      printf("Godzilla\n");
    else
      printf("MechaGodzilla\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x24(%rbp)
cmp    $0x0,%eax
je     1273 <main+0x153>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0xffffffff,-0x30(%rbp)
lea    0xe96(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1199 <main+0x79>
cmpl   $0x0,-0x1c(%rbp)
jne    1199 <main+0x79>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11ef <main+0xcf>
lea    0xe50(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    11d5 <main+0xb5>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    11db <main+0xbb>
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a0 <main+0x80>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1245 <main+0x125>
lea    0xdfa(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    122b <main+0x10b>
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1231 <main+0x111>
mov    -0x20(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f6 <main+0xd6>
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jl     1262 <main+0x142>
lea    0xdbe(%rip),%rdi
call   1030 <printf@plt>
jmp    126e <main+0x14e>
lea    0xda8(%rip),%rdi
call   1030 <printf@plt>
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0x10(%rsp)
jae    1159 <main+0x39>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea3(%rip),%r14
lea    0x14(%rsp),%rbp
jmp    1191 <main+0x71>
nopw   0x0(%rax,%rax,1)
cmp    %r15d,%r13d
lea    0xe91(%rip),%rdi
lea    0xe85(%rip),%rax
cmovl  %rax,%rdi
call   1030 <puts@plt>
subl   $0x1,0x10(%rsp)
jb     1148 <main+0x28>
lea    0xe68(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
or     %eax,%ecx
jne    11c5 <main+0xa5>
lea    0xe58(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
mov    $0xffffffff,%r15d
mov    $0xffffffff,%r13d
test   %eax,%eax
jle    1207 <main+0xe7>
xor    %r12d,%r12d
mov    $0xffffffff,%ebx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%r13d
cmp    %r13d,%ebx
cmovg  %ebx,%r13d
add    $0x1,%r12d
mov    %r13d,%ebx
cmp    0xc(%rsp),%r12d
jl     11e0 <main+0xc0>
cmpl   $0x0,0x8(%rsp)
jle    1170 <main+0x50>
xor    %ebx,%ebx
mov    $0xffffffff,%r15d
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    %eax,%r15d
cmovle %eax,%r15d
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
jl     1220 <main+0x100>
jmp    1170 <main+0x50>

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

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