#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 *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  int num, i;
  char top[21], temp[21];
  scanf("%d\n", &num);
  for (i = 0; i < num; i++) {
    if (i == 0) {
      scanf("%s\n", top);
    } else {
      scanf("%s\n", temp);
      if (strcmp(top, temp) > 0)
        strcpy(top, temp);
    }
  }
  printf("%s\n", top);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e3 <main+0xa3>
cmpl   $0x0,-0xc(%rbp)
jne    1195 <main+0x55>
lea    -0x30(%rbp),%rsi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
jmp    11d0 <main+0x90>
lea    -0x50(%rbp),%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jle    11cb <main+0x8b>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11d0 <main+0x90>
jmp    11d5 <main+0x95>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <main+0x28>
lea    -0x30(%rbp),%rsi
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xeaf(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11d3 <main+0x93>
lea    0xe99(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x2,0xc(%rsp)
jl     11d3 <main+0x93>
mov    $0x1,%ebp
lea    0xe7a(%rip),%r14
lea    0x30(%rsp),%rbx
lea    0x10(%rsp),%r15
jmp    11a9 <main+0x69>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jge    11d3 <main+0x93>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jle    11a0 <main+0x60>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    11a0 <main+0x60>
lea    0xe2a(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [21 x i8]
%5 = alloca [21 x i8]
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %7
7: ; preds = %30, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %33
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %29
17: ; preds = %11
%18 = getelementptr inbounds [21 x i8], [21 x i8]* %5, i64 0, i64 0
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%21 = getelementptr inbounds [21 x i8], [21 x i8]* %5, i64 0, i64 0
%22 = call i64 @strcmp(i8* %20, i8* %21)
%23 = icmp sgt i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %17
%25 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%26 = getelementptr inbounds [21 x i8], [21 x i8]* %5, i64 0, i64 0
%27 = call i32 @strcpy(i8* %25, i8* %26)
br label %28
28: ; preds = %24, %17
br label %29
29: ; preds = %28, %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %7
33: ; preds = %7
%34 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca [21 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %25
14: ; preds = %10, %21
%15 = phi i32 [ %22, %21 ], [ 1, %10 ]
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%17 = call i64 @strcmp(i8* %5, i8* %6)
%18 = icmp sgt i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 @strcpy(i8* %5, i8* %6)
br label %21
21: ; preds = %19, %14
%22 = add nuw nsw i32 %15, 1
%23 = load i32, i32* %1
%24 = icmp slt i32 %22, %23
br i1 %24, label %14, label %25
25: ; preds = %21, %10, %0
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}