#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(void) {
  int T, n;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    if (360 % n == 0) {
      printf("y ");
    } else {
      printf("n ");
    }
    if (n <= 360) {
      printf("y ");
    } else {
      printf("n ");
    }
    if ((n * (n + 1) / 2) <= 360) {
      printf("y");
    } else {
      printf("n ");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1209 <main+0xe9>
lea    0xea6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x168,%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1186 <main+0x66>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x72>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x168,-0xc(%rbp)
jg     11b0 <main+0x90>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
jmp    11bc <main+0x9c>
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x168,%eax
jg     11ec <main+0xcc>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
jmp    11f8 <main+0xd8>
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
subl   $0x1,0x4(%rsp)
jae    115e <main+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xe9b(%rip),%r14
mov    %rsp,%r15
lea    0xe94(%rip),%rbx
lea    0xe90(%rip),%r12
jmp    1199 <main+0x69>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
subl   $0x1,0x4(%rsp)
jb     1150 <main+0x20>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    $0x168,%eax
xor    %edx,%edx
idivl  (%rsp)
mov    %rbx,%rdi
test   %edx,%edx
je     11b8 <main+0x88>
mov    %r12,%rdi
call   1040 <printf@plt>
cmpl   $0x169,(%rsp)
mov    %rbx,%rdi
jl     11cc <main+0x9c>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    (%rsp),%eax
lea    0x1(%rax),%ecx
imul   %eax,%ecx
cmp    $0x2d1,%ecx
jg     1180 <main+0x50>
mov    $0x79,%edi
call   1030 <putchar@plt>
jmp    1188 <main+0x58>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"y \00"
@.str.2 = [3 x i8] c"n \00"
@.str.3 = [2 x i8] c"y\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %36, %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %38
9: ; preds = %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = srem i32 360, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %18
16: ; preds = %9
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 360
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %25
23: ; preds = %18
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
%26 = load i32, i32* %3
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
%29 = mul nsw i32 %26, %28
%30 = sdiv i32 %29, 2
%31 = icmp sle i32 %30, 360
br i1 %31, label %32, label %34
32: ; preds = %25
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %36
34: ; preds = %25
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %5
38: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"y \00"
@.str.2 = [3 x i8] c"n \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast 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 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %33, label %9
9: ; preds = %0, %28
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = srem i32 360, %11
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 @printf(i8* dereferenceable(1) %14)
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 361
%18 = select i1 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%19 = call i32 @printf(i8* dereferenceable(1) %18)
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
%22 = mul nsw i32 %21, %20
%23 = icmp slt i32 %22, 722
br i1 %23, label %24, label %26
24: ; preds = %9
%25 = call i32 @putchar(i32 121)
br label %28
26: ; preds = %9
%27 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
%29 = call i32 @putchar(i32 10)
%30 = load i32, i32* %1
%31 = add nsw i32 %30, -1
store i32 %31, i32* %1
%32 = icmp eq i32 %30, 0
br i1 %32, label %33, label %9
33: ; preds = %28, %0
ret i32 0
}