#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 i, j, t, n, c = 1;
  int rank[1000], hostel_id[10];
  scanf("%d", &t);
  for (i = 1; i <= t; i++) {
    scanf("%d", &n);
    for (j = 0; j < n; j++)
      scanf("%d", &hostel_id[j]);
    for (j = 0; j < n; j++)
      scanf("%d", &rank[j]);
    for (j = 0; j < n; j++) {
      if (hostel_id[j] != hostel_id[0]) {
        c = 0;
        break;
      }
      if (rank[j] < 15) {
        c = 0;
        break;
      }
    }
    if (c == 0)
      printf("No Party\n");
    else
      printf("Party\n");
    c = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xff0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xec0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     128d <main+0x16d>
lea    0xe9d(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ab <main+0x8b>
movslq -0xc(%rbp),%rax
lea    -0xff0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe68(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1173 <main+0x53>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ea <main+0xca>
movslq -0xc(%rbp),%rax
lea    -0xfc0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe29(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b2 <main+0x92>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1251 <main+0x131>
movslq -0xc(%rbp),%rax
mov    -0xff0(%rbp,%rax,4),%eax
cmp    -0xff0(%rbp),%eax
je     1220 <main+0x100>
movl   $0x0,-0x18(%rbp)
jmp    1251 <main+0x131>
movslq -0xc(%rbp),%rax
cmpl   $0xf,-0xfc0(%rbp,%rax,4)
0f
jge    123e <main+0x11e>
movl   $0x0,-0x18(%rbp)
jmp    1251 <main+0x131>
jmp    1243 <main+0x123>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f1 <main+0xd1>
cmpl   $0x0,-0x18(%rbp)
jne    126c <main+0x14c>
lea    0xda1(%rip),%rdi
call   1030 <printf@plt>
jmp    1278 <main+0x158>
lea    0xd93(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0xff0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xfe8,%rsp
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    124a <main+0x12a>
mov    $0x1,%r12d
lea    0xea6(%rip),%r15
lea    0x8(%rsp),%r14
lea    0xea0(%rip),%r13
jmp    1188 <main+0x68>
lea    0xe94(%rip),%rdi
nop
call   1030 <puts@plt>
lea    0x1(%r12),%eax
cmp    0xc(%rsp),%r12d
mov    %eax,%r12d
jge    124a <main+0x12a>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
mov    %r13,%rdi
jle    1170 <main+0x50>
lea    0x10(%rsp),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11b0 <main+0x90>
mov    %r13,%rdi
test   %eax,%eax
jle    1170 <main+0x50>
lea    0x40(%rsp),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11e0 <main+0xc0>
mov    %eax,%eax
mov    %r13,%rdi
test   %eax,%eax
jle    1170 <main+0x50>
mov    0x10(%rsp),%ecx
add    $0xffffffffffffffff,%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpl   $0xe,0x40(%rsp,%rdx,4)
jle    1168 <main+0x48>
cmp    %rdx,%rax
je     1242 <main+0x122>
lea    0x1(%rdx),%rsi
cmp    %ecx,0x14(%rsp,%rdx,4)
mov    %rsi,%rdx
je     1220 <main+0x100>
jmp    1168 <main+0x48>
mov    %r13,%rdi
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0xfe8,%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 = [10 x i8] c"No Party\0A\00"
@.str.2 = [7 x i8] c"Party\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 [1000 x i32]
%8 = alloca [10 x i32]
store i32 0, i32* %1
store i32 1, i32* %6
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 1, i32* %2
br label %10
10: ; preds = %74, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %77
14: ; preds = %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 0, i32* %3
br label %16
16: ; preds = %25, %14
%17 = load i32, i32* %3
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %22
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
br label %25
25: ; preds = %20
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %16
28: ; preds = %16
store i32 0, i32* %3
br label %29
29: ; preds = %38, %28
%30 = load i32, i32* %3
%31 = load i32, i32* %5
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %41
33: ; preds = %29
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [1000 x i32], [1000 x i32]* %7, i64 0, i64 %35
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %36)
br label %38
38: ; preds = %33
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %29
41: ; preds = %29
store i32 0, i32* %3
br label %42
42: ; preds = %63, %41
%43 = load i32, i32* %3
%44 = load i32, i32* %5
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %66
46: ; preds = %42
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 0
%52 = load i32, i32* %51
%53 = icmp ne i32 %50, %52
br i1 %53, label %54, label %55
54: ; preds = %46
store i32 0, i32* %6
br label %66
55: ; preds = %46
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [1000 x i32], [1000 x i32]* %7, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = icmp slt i32 %59, 15
br i1 %60, label %61, label %62
61: ; preds = %55
store i32 0, i32* %6
br label %66
62: ; preds = %55
br label %63
63: ; preds = %62
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
br label %42
66: ; preds = %61, %54, %42
%67 = load i32, i32* %6
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %73
71: ; preds = %66
%72 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %73
73: ; preds = %71, %69
store i32 1, i32* %6
br label %74
74: ; preds = %73
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
store i32 %76, i32* %2
br label %10
77: ; preds = %10
ret i32 0
}

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