#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 scanf(char *, ...);
int main(void) {
  int n, i, np, ns, teste = 1;
  char prim[11], seg[11];
  while (scanf("%d", &n) == 1 && n) {
    scanf(" %s %s", prim, seg);
    printf("Teste %d\n", teste++);
    for (i = 0; i < n; i++) {
      scanf("%d %d", &np, &ns);
      printf("%s\n", ((np + ns) % 2 == 0 ? prim : seg));
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x2f(%rbp)
jne    1162 <main+0x42>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x2f(%rbp)
mov    -0x2f(%rbp),%al
test   $0x1,%al
jne    1172 <main+0x52>
jmp    1229 <main+0x109>
lea    -0x23(%rbp),%rsi
lea    -0x2e(%rbp),%rdx
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1216 <main+0xf6>
lea    0xe56(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ee <main+0xce>
lea    -0x23(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    11f6 <main+0xd6>
lea    -0x2e(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a8 <main+0x88>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1136 <main+0x16>
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    $0x28,%rsp
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1251 <main+0x111>
cmpl   $0x0,0x4(%rsp)
je     1251 <main+0x111>
mov    $0x1,%r13d
lea    0x1d(%rsp),%rbx
lea    0xe8a(%rip),%rbp
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe59(%rip),%rdi
mov    %rbx,%rsi
lea    0x12(%rsp),%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe4a(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1220 <main+0xe0>
xor    %r15d,%r15d
jmp    11f0 <main+0xb0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1040 <puts@plt>
add    $0x1,%r15d
cmp    0x4(%rsp),%r15d
jge    1220 <main+0xe0>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x8(%rsp),%eax
add    0xc(%rsp),%eax
mov    %rbx,%rdi
test   $0x1,%al
je     11e0 <main+0xa0>
lea    0x12(%rsp),%rdi
jmp    11e0 <main+0xa0>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xde3(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1251 <main+0x111>
add    $0x1,%r13d
cmpl   $0x0,0x4(%rsp)
jne    11a0 <main+0x60>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c" %s %s\00"
@.str.2 = [10 x i8] c"Teste %d\0A\00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [2 x i8] c"\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 [11 x i8]
%8 = alloca [11 x i8]
store i32 0, i32* %1
store i32 1, i32* %6
br label %9
9: ; preds = %45, %0
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %12, %9
%16 = phi i1 [ false, %9 ], [ %14, %12 ]
br i1 %16, label %17, label %47
17: ; preds = %15
%18 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%19 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19)
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %21)
store i32 0, i32* %3
br label %24
24: ; preds = %42, %17
%25 = load i32, i32* %3
%26 = load i32, i32* %2
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %45
28: ; preds = %24
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %4, i32* %5)
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = add nsw i32 %30, %31
%33 = srem i32 %32, 2
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
br label %39
37: ; preds = %28
%38 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
br label %39
39: ; preds = %37, %35
%40 = phi i8* [ %36, %35 ], [ %38, %37 ]
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %39
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %24
45: ; preds = %24
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %9
47: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c" %s %s\00"
@.str.2 = [10 x i8] c"Teste %d\0A\00"
@.str.3 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [11 x i8]
%5 = alloca [11 x i8]
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = icmp eq i32 %11, 1
%13 = load i32, i32* %1
%14 = icmp ne i32 %13, 0
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %16, label %43
16: ; preds = %0, %36
%17 = phi i32 [ %19, %36 ], [ 1, %0 ]
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %10)
%19 = add nuw nsw i32 %17, 1
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%21 = load i32, i32* %1
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %36
23: ; preds = %16, %23
%24 = phi i32 [ %33, %23 ], [ 0, %16 ]
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %2, i32* %3)
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = add nsw i32 %27, %26
%29 = and i32 %28, 1
%30 = icmp eq i32 %29, 0
%31 = select i1 %30, i8* %9, i8* %10
%32 = call i32 @puts(i8* %31)
%33 = add nuw nsw i32 %24, 1
%34 = load i32, i32* %1
%35 = icmp slt i32 %33, %34
br i1 %35, label %23, label %36
36: ; preds = %23, %16
%37 = call i32 @putchar(i32 10)
%38 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%39 = icmp eq i32 %38, 1
%40 = load i32, i32* %1
%41 = icmp ne i32 %40, 0
%42 = select i1 %39, i1 %41, i1 false
br i1 %42, label %16, label %43
43: ; preds = %36, %0
ret i32 0
}