#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;
  scanf("%d", &t);
  while (t--) {
    int x, y, k, n;
    scanf("%d%d%d%d", &x, &y, &k, &n);
    int p[n], c[n], flag = 0, i;
    for (i = 0; i < n; ++i) {
      scanf("%d%d", &p[i], &c[i]);
      if (p[i] >= x - y && c[i] <= k) {
        ++flag;
      }
    }
    if (flag == 0) {
      printf("UnluckyChef\n");
    } else {
      printf("LuckyChef\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     127c <main+0x15c>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1249 <main+0x129>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x48(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jl     1236 <main+0x116>
mov    -0x40(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jg     1236 <main+0x116>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    123b <main+0x11b>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11c8 <main+0xa8>
cmpl   $0x0,-0x34(%rbp)
jne    1264 <main+0x144>
lea    0xdaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1270 <main+0x150>
lea    0xdab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
jmp    1141 <main+0x21>
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xece(%rip),%rdi
lea    -0x30(%rbp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,-0x30(%rbp)
jae    115a <main+0x3a>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xeb2(%rip),%r13
lea    0xe9c(%rip),%r14
jmp    1196 <main+0x76>
nopw   0x0(%rax,%rax,1)
test   %ebx,%ebx
lea    0xe90(%rip),%rdi
lea    0xe93(%rip),%r13
cmove  %r13,%rdi
mov    -0x48(%rbp),%rbx
call   1030 <puts@plt>
mov    %rbx,%rsp
subl   $0x1,-0x30(%rbp)
jb     1149 <main+0x29>
lea    0xe63(%rip),%rdi
lea    -0x3c(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x2c(%rbp),%r8
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    -0x2c(%rbp),%eax
mov    %rsp,%r15
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r12
mov    %r12,%rsp
mov    %r13,%rdi
test   %eax,%eax
jle    1188 <main+0x68>
mov    %rbx,-0x48(%rbp)
xor    %r13d,%r13d
xor    %ebx,%ebx
jmp    1219 <main+0xf9>
nopl   0x0(%rax)
add    $0x1,%r13
movslq -0x2c(%rbp),%rax
add    $0x4,%r12
add    $0x4,%r15
cmp    %rax,%r13
jge    1170 <main+0x50>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    -0x3c(%rbp),%eax
sub    -0x38(%rbp),%eax
cmp    %eax,(%r15)
jl     1200 <main+0xe0>
mov    (%r12),%eax
xor    %ecx,%ecx
cmp    -0x34(%rbp),%eax
setle  %cl
add    %ecx,%ebx
jmp    1200 <main+0xe0>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d%d%d%d\00"
@.str.2 = [5 x i8] c"%d%d\00"
@.str.3 = [13 x i8] c"UnluckyChef\0A\00"
@.str.4 = [11 x i8] c"LuckyChef\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 i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %13
13: ; preds = %67, %0
%14 = load i32, i32* %2
%15 = add nsw i32 %14, -1
store i32 %15, i32* %2
%16 = icmp ne i32 %14, 0
br i1 %16, label %17, label %69
17: ; preds = %13
%18 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %7
%22 = alloca i32, i64 %20
store i64 %20, i64* %8
%23 = load i32, i32* %6
%24 = zext i32 %23 to i64
%25 = alloca i32, i64 %24
store i64 %24, i64* %9
store i32 0, i32* %10
store i32 0, i32* %11
br label %26
26: ; preds = %57, %17
%27 = load i32, i32* %11
%28 = load i32, i32* %6
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %60
30: ; preds = %26
%31 = load i32, i32* %11
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %22, i64 %32
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %25, i64 %35
%37 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %33, i32* %36)
%38 = load i32, i32* %11
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %22, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %3
%43 = load i32, i32* %4
%44 = sub nsw i32 %42, %43
%45 = icmp sge i32 %41, %44
br i1 %45, label %46, label %56
46: ; preds = %30
%47 = load i32, i32* %11
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %25, i64 %48
%50 = load i32, i32* %49
%51 = load i32, i32* %5
%52 = icmp sle i32 %50, %51
br i1 %52, label %53, label %56
53: ; preds = %46
%54 = load i32, i32* %10
%55 = add nsw i32 %54, 1
store i32 %55, i32* %10
br label %56
56: ; preds = %53, %46, %30
br label %57
57: ; preds = %56
%58 = load i32, i32* %11
%59 = add nsw i32 %58, 1
store i32 %59, i32* %11
br label %26
60: ; preds = %26
%61 = load i32, i32* %10
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %67
65: ; preds = %60
%66 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %67
67: ; preds = %65, %63
%68 = load i8*, i8** %7
br label %13
69: ; preds = %13
%70 = load i32, i32* %1
ret i32 %70
}

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