#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 *, long, long);
int /*<<< orphan*/ scanf(char *, long *);
int main(int argc, char *argv[]) {
  long min = 999999999, max = -min;
  long cnt;
  scanf("%li", &cnt);
  while (cnt--) {
    auto long i;
    scanf("%li", &i);
    min = i >= min ? min : i;
    max = i <= max ? max : i;
  }
  printf("%li %li", min, max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x3b9ac9ff,-0x18(%rbp)
3b
xor    %eax,%eax
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x28(%rbp)
cmp    $0x0,%rax
je     11dc <main+0xbc>
lea    0xe8c(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     119c <main+0x7c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    11a4 <main+0x84>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     11c7 <main+0xa7>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    11cf <main+0xaf>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1158 <main+0x38>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
subq   $0x1,0x8(%rsp)
jae    1152 <main+0x32>
mov    $0xffffffffc4653601,%r14
mov    $0x3b9ac9ff,%ebx
jmp    1196 <main+0x76>
mov    $0x3b9ac9ff,%ebx
mov    $0xffffffffc4653601,%r14
lea    0xe9f(%rip),%r15
lea    0x10(%rsp),%r12
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
cmp    %rbx,%rax
cmovl  %rax,%rbx
cmp    %r14,%rax
cmovg  %rax,%r14
subq   $0x1,0x8(%rsp)
jae    1170 <main+0x50>
lea    0xe63(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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