#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, ara[10], i, j;
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    for (j = 0; j < 5; j++) {
      scanf("%d", &ara[j]);
    }
    if (ara[0] == 1 && ara[1] == 2 && ara[2] == 3 && ara[3] == 4 && ara[4] == 5)
      printf("Y\n");
    else if (ara[0] == 2 && ara[1] == 3 && ara[2] == 4 && ara[3] == 5 &&
             ara[4] == 6)
      printf("Y\n");
    else
      printf("N\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1236 <main+0x116>
movl   $0x0,-0x38(%rbp)
cmpl   $0x5,-0x38(%rbp)
jge    118c <main+0x6c>
movslq -0x38(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe87(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1159 <main+0x39>
cmpl   $0x1,-0x30(%rbp)
jne    11cf <main+0xaf>
cmpl   $0x2,-0x2c(%rbp)
jne    11cf <main+0xaf>
cmpl   $0x3,-0x28(%rbp)
jne    11cf <main+0xaf>
cmpl   $0x4,-0x24(%rbp)
jne    11cf <main+0xaf>
cmpl   $0x5,-0x20(%rbp)
jne    11cf <main+0xaf>
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
jmp    1223 <main+0x103>
cmpl   $0x2,-0x30(%rbp)
jne    1212 <main+0xf2>
cmpl   $0x3,-0x2c(%rbp)
jne    1212 <main+0xf2>
cmpl   $0x4,-0x28(%rbp)
jne    1212 <main+0xf2>
cmpl   $0x5,-0x24(%rbp)
jne    1212 <main+0xf2>
cmpl   $0x6,-0x20(%rbp)
jne    1212 <main+0xf2>
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
jmp    121e <main+0xfe>
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
jmp    1223 <main+0x103>
jmp    1228 <main+0x108>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1146 <main+0x26>
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    $0x38,%rsp
lea    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    122c <main+0x10c>
xor    %r14d,%r14d
lea    0x20(%rsp),%r13
lea    0xea7(%rip),%rbx
lea    0x10(%rsp),%r12
lea    0xea0(%rip),%r15
jmp    11a6 <main+0x86>
nopw   0x0(%rax,%rax,1)
xor    $0x2,%ebp
xor    $0x3,%eax
or     %ebp,%eax
xor    $0x4,%edx
xor    $0x5,%esi
xor    $0x6,%ecx
or     %esi,%ecx
or     %edx,%ecx
or     %eax,%ecx
lea    0xe75(%rip),%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
add    $0x1,%r14d
cmp    0xc(%rsp),%r14d
jge    122c <main+0x10c>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
lea    0x18(%rsp),%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
lea    0x1c(%rsp),%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%ebp
mov    0x14(%rsp),%eax
mov    0x18(%rsp),%edx
mov    0x1c(%rsp),%esi
mov    0x20(%rsp),%ecx
cmp    $0x1,%ebp
jne    1170 <main+0x50>
cmp    $0x2,%eax
jne    1170 <main+0x50>
cmp    $0x3,%edx
jne    1170 <main+0x50>
cmp    $0x4,%esi
jne    1170 <main+0x50>
mov    %r15,%rdi
cmp    $0x5,%ecx
je     1192 <main+0x72>
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x38,%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 = [3 x i8] c"Y\0A\00"
@.str.2 = [3 x i8] c"N\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %4
br label %7
7: ; preds = %71, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %74
11: ; preds = %7
store i32 0, i32* %5
br label %12
12: ; preds = %20, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
br label %20
20: ; preds = %15
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %12
23: ; preds = %12
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %45
27: ; preds = %23
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %45
31: ; preds = %27
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 3
br i1 %34, label %35, label %45
35: ; preds = %31
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 4
br i1 %38, label %39, label %45
39: ; preds = %35
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 5
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %70
45: ; preds = %39, %35, %31, %27, %23
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, 2
br i1 %48, label %49, label %67
49: ; preds = %45
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%51 = load i32, i32* %50
%52 = icmp eq i32 %51, 3
br i1 %52, label %53, label %67
53: ; preds = %49
%54 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, 4
br i1 %56, label %57, label %67
57: ; preds = %53
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 5
br i1 %60, label %61, label %67
61: ; preds = %57
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%63 = load i32, i32* %62
%64 = icmp eq i32 %63, 6
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %69
67: ; preds = %61, %57, %53, %49, %45
%68 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %69
69: ; preds = %67, %65
br label %70
70: ; preds = %69, %43
br label %71
71: ; preds = %70
%72 = load i32, i32* %4
%73 = add nsw i32 %72, 1
store i32 %73, i32* %4
br label %7
74: ; preds = %7
ret i32 0
}

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