#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 num, que, i, year[51];
  char name[51][31];
  scanf("%d %d", &num, &que);
  for (i = 0; i < num; i++) {
    scanf("%d %s", &year[i], name[i]);
  }
  i = 0;
  while (year[i] <= que && i < num) {
    i++;
  }
  if (i == 0) {
    printf("kogakubu10gokan\n");
  } else {
    printf("%s\n", name[i - 1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x720,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119b <main+0x7b>
movslq -0x10(%rbp),%rax
lea    -0xe0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x10(%rbp),%rax
lea    -0x710(%rbp),%rdx
imul   $0x1f,%rax,%rax
add    %rax,%rdx
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114f <main+0x2f>
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x711(%rbp)
jg     11cd <main+0xad>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x711(%rbp)
mov    -0x711(%rbp),%al
test   $0x1,%al
jne    11e0 <main+0xc0>
jmp    11ee <main+0xce>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a2 <main+0x82>
cmpl   $0x0,-0x10(%rbp)
jne    120b <main+0xeb>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122f <main+0x10f>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
cltq
lea    -0x710(%rbp),%rsi
imul   $0x1f,%rax,%rax
add    %rax,%rsi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x718,%rsp
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    1196 <main+0x76>
lea    0x10(%rsp),%r14
lea    0xe0(%rsp),%r12
lea    0xea4(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r14
add    $0x1f,%r12
cmp    %rax,%rbx
jl     1170 <main+0x50>
movslq %eax,%rcx
movabs $0xfffffffe00000000,%rax
ff ff ff
mov    0xc(%rsp),%edx
xor    %edi,%edi
movabs $0x100000000,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %rsi,%rax
lea    0x1(%rdi),%rbx
cmp    %edx,0x10(%rsp,%rdi,4)
jg     11d5 <main+0xb5>
cmp    %rcx,%rdi
mov    %rbx,%rdi
jl     11c0 <main+0xa0>
cmp    $0x1,%ebx
jne    11e3 <main+0xc3>
lea    0xe2b(%rip),%rdi
jmp    11fc <main+0xdc>
mov    %rax,%rcx
sar    $0x20,%rcx
sar    $0x1b,%rax
sub    %rcx,%rax
lea    (%rsp,%rax,1),%rdi
add    $0xe0,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x718,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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