#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int T, N, flag = 1;
  int x, nx, i, j, r;
  scanf("%d", &T);
  for (i = 0; i < T; i++) {
    flag = 1;
    scanf("%d", &N);
    scanf("%d", &x);
    for (j = 1; j < N; j++) {
      scanf("%d", &nx);
      if (nx != x) {
        flag = 0;
      }
    }
    for (j = 0; j < N; j++) {
      scanf(" %d", &r);
      if (r < 15) {
        flag = 0;
      }
    }
    if (flag)
      puts("Party");
    else
      puts("No Party");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    124a <main+0x12a>
movl   $0x1,-0x10(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c9 <main+0xa9>
lea    0xe67(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     11b6 <main+0x96>
movl   $0x0,-0x10(%rbp)
jmp    11bb <main+0x9b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1187 <main+0x67>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1210 <main+0xf0>
lea    0xe1d(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xf,-0x24(%rbp)
jge    11fd <main+0xdd>
movl   $0x0,-0x10(%rbp)
jmp    1202 <main+0xe2>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11d0 <main+0xb0>
cmpl   $0x0,-0x10(%rbp)
je     122b <main+0x10b>
lea    0xde6(%rip),%rdi
call   1030 <puts@plt>
jmp    1237 <main+0x117>
lea    0xdd2(%rip),%rdi
call   1030 <puts@plt>
jmp    123c <main+0x11c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114d <main+0x2d>
mov    -0x4(%rbp),%eax
add    $0x30,%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    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1241 <main+0x121>
xor    %r14d,%r14d
lea    0xead(%rip),%rbx
lea    0x10(%rsp),%r13
lea    0xea0(%rip),%r12
xor    %eax,%eax
jmp    11a5 <main+0x85>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%r12
test   %r15d,%r15d
lea    0xe8a(%rip),%rdi
lea    0xe80(%rip),%rax
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
add    $0x1,%eax
cmp    0x4(%rsp),%eax
lea    0xe62(%rip),%rbx
jge    1241 <main+0x121>
mov    %eax,0x8(%rsp)
mov    %r12,%rbp
mov    %rbx,%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
mov    (%rsp),%eax
mov    $0x1,%r15d
cmp    $0x2,%eax
jl     1203 <main+0xe3>
mov    $0x1,%r12d
mov    $0x1,%r15d
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    0x14(%rsp),%eax
cmovne %r14d,%r15d
add    $0x1,%r12d
mov    (%rsp),%eax
cmp    %eax,%r12d
jl     11e0 <main+0xc0>
test   %eax,%eax
jle    1170 <main+0x50>
xor    %ebx,%ebx
mov    %rbp,%r12
lea    0xc(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
mov    %rbp,%rsi
call   1040 <scanf@plt>
cmpl   $0xf,0xc(%rsp)
cmovl  %r14d,%r15d
add    $0x1,%ebx
cmp    (%rsp),%ebx
jl     1220 <main+0x100>
jmp    1173 <main+0x53>
xor    %eax,%eax
add    $0x18,%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 = [4 x i8] c" %d\00"
@.str.2 = [6 x i8] c"Party\00"
@.str.3 = [9 x i8] c"No Party\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
store i32 0, i32* %1
store i32 1, i32* %4
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %7
br label %11
11: ; preds = %54, %0
%12 = load i32, i32* %7
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %57
15: ; preds = %11
store i32 1, i32* %4
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 1, i32* %8
br label %18
18: ; preds = %29, %15
%19 = load i32, i32* %8
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %32
22: ; preds = %18
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%24 = load i32, i32* %6
%25 = load i32, i32* %5
%26 = icmp ne i32 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %22
store i32 0, i32* %4
br label %28
28: ; preds = %27, %22
br label %29
29: ; preds = %28
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %18
32: ; preds = %18
store i32 0, i32* %8
br label %33
33: ; preds = %43, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %3
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %46
37: ; preds = %33
%38 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%39 = load i32, i32* %9
%40 = icmp slt i32 %39, 15
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 0, i32* %4
br label %42
42: ; preds = %41, %37
br label %43
43: ; preds = %42
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %33
46: ; preds = %33
%47 = load i32, i32* %4
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %53
51: ; preds = %46
%52 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %51, %49
br label %54
54: ; preds = %53
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %11
57: ; preds = %11
%58 = load i32, i32* %1
ret i32 %58
}

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