#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 *, char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char, char);
int main() {
  char S[10];
  char set[25][3];
  int i, j, n;
  scanf("%s", S);
  scanf("%d", &n);
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 5; j++) {
      sprintf(set[i * 5 + j], "%c%c", S[i], S[j]);
    }
  }
  printf("%s\n", set[n - 1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
lea    -0x6c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0x5,-0x64(%rbp)
jge    11da <main+0xaa>
movl   $0x0,-0x68(%rbp)
cmpl   $0x5,-0x68(%rbp)
jge    11c7 <main+0x97>
imul   $0x5,-0x64(%rbp),%eax
add    -0x68(%rbp),%eax
cltq
lea    -0x60(%rbp),%rdi
imul   $0x3,%rax,%rax
add    %rax,%rdi
movslq -0x64(%rbp),%rax
mov    -0xe(%rbp,%rax,1),%cl
movslq -0x68(%rbp),%rax
lea    0xe5a(%rip),%rsi
movsbl %cl,%edx
movsbl -0xe(%rbp,%rax,1),%ecx
call   1050 <sprintf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    117b <main+0x4b>
jmp    11cc <main+0x9c>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    116a <main+0x3a>
mov    -0x6c(%rbp),%eax
sub    $0x1,%eax
cltq
lea    -0x60(%rbp),%rsi
imul   $0x3,%rax,%rax
add    %rax,%rsi
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xec0(%rip),%rdi
xor    %ebx,%ebx
lea    0x2(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe9b(%rip),%r14
nopl   0x0(%rax,%rax,1)
lea    (%rsp,%rbx,1),%rdi
add    $0x10,%rdi
movsbl (%r15),%edx
movsbl 0x2(%rsp),%ecx
mov    %r14,%rsi
call   1050 <sprintf@plt>
lea    (%rsp,%rbx,1),%rdi
add    $0x13,%rdi
movsbl (%r15),%edx
movsbl 0x3(%rsp),%ecx
mov    %r14,%rsi
call   1050 <sprintf@plt>
lea    (%rsp,%rbx,1),%rdi
add    $0x16,%rdi
movsbl (%r15),%edx
movsbl 0x4(%rsp),%ecx
mov    %r14,%rsi
call   1050 <sprintf@plt>
lea    (%rsp,%rbx,1),%rdi
add    $0x19,%rdi
movsbl (%r15),%edx
movsbl 0x5(%rsp),%ecx
mov    %r14,%rsi
call   1050 <sprintf@plt>
lea    (%rsp,%rbx,1),%rdi
add    $0x1c,%rdi
movsbl (%r15),%edx
movsbl 0x6(%rsp),%ecx
mov    %r14,%rsi
call   1050 <sprintf@plt>
add    $0xf,%rbx
add    $0x1,%r15
cmp    $0x4b,%rbx
jne    1170 <main+0x40>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
lea    (%rsp,%rax,1),%rsi
add    $0xd,%rsi
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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