#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int main() {
  FILE *f = fopen("INP.TXT", "r");
  int n, m, l, r, t, b;
  fscanf(f, "%d", &n);
  fscanf(f, "%d", &m);
  l = r = m;
  fscanf(f, "%d", &m);
  t = b = m;
  for (n--; n; n--) {
    fscanf(f, "%d", &m);
    l = (m < l) ? m : l;
    r = (m > r) ? m : r;
    fscanf(f, "%d", &m);
    t = (m < t) ? m : t;
    b = (m > b) ? m : b;
  }
  fclose(f);
  f = fopen("OUT.TXT", "w");
  fprintf(f, "%d\n", (r - l > b - t) ? r - l : b - t);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe85(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe68(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1289 <main+0x149>
mov    -0x10(%rbp),%rdi
lea    0xe38(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11f2 <main+0xb2>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11f8 <main+0xb8>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1215 <main+0xd5>
mov    -0x18(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    121b <main+0xdb>
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xdde(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    124c <main+0x10c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1252 <main+0x112>
mov    -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    126f <main+0x12f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1275 <main+0x135>
mov    -0x28(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11bd <main+0x7d>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xd74(%rip),%rdi
lea    0xd75(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    -0x24(%rbp),%ecx
cmp    %ecx,%eax
jle    12d3 <main+0x193>
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    12dc <main+0x19c>
mov    -0x28(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%edx
lea    0xd2d(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xea2(%rip),%r15
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <fscanf@plt>
mov    %rsp,%r12
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <fscanf@plt>
mov    (%rsp),%r13d
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <fscanf@plt>
mov    (%rsp),%r15d
addl   $0xffffffff,0x4(%rsp)
je     1204 <main+0xc4>
mov    %r15d,%ebp
mov    %r13d,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
lea    0xe50(%rip),%rsi
mov    %r14,%r12
mov    %rsp,%r14
mov    %r14,%rdx
call   1040 <fscanf@plt>
mov    (%rsp),%eax
cmp    %ebx,%eax
cmovl  %eax,%ebx
cmp    %r13d,%eax
cmovg  %eax,%r13d
mov    %r12,%rdi
lea    0xe29(%rip),%rsi
mov    %r14,%rdx
mov    %r12,%r14
call   1040 <fscanf@plt>
mov    (%rsp),%eax
cmp    %ebp,%eax
cmovl  %eax,%ebp
cmp    %r15d,%eax
cmovg  %eax,%r15d
addl   $0xffffffff,0x4(%rsp)
jne    11b0 <main+0x70>
jmp    120a <main+0xca>
mov    %r13d,%ebx
mov    %r15d,%ebp
sub    %ebp,%r15d
sub    %ebx,%r13d
mov    %r14,%rdi
call   1030 <fclose@plt>
lea    0xdee(%rip),%rdi
lea    0xdef(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
cmp    %r15d,%r13d
cmovle %r15d,%r13d
lea    0xddb(%rip),%rsi
mov    %rax,%rdi
mov    %r13d,%edx
call   1050 <fprintf@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [8 x i8] c"OUT.TXT\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [4 x i8] c"%d\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 i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %9, i32** %2
%10 = load i32*, i32** %2
%11 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%12 = load i32*, i32** %2
%13 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%14 = load i32, i32* %4
store i32 %14, i32* %6
store i32 %14, i32* %5
%15 = load i32*, i32** %2
%16 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %4
store i32 %17, i32* %8
store i32 %17, i32* %7
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
br label %20
20: ; preds = %64, %0
%21 = load i32, i32* %3
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %67
23: ; preds = %20
%24 = load i32*, i32** %2
%25 = call i32 @fscanf(i32* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = load i32, i32* %4
br label %33
31: ; preds = %23
%32 = load i32, i32* %5
br label %33
33: ; preds = %31, %29
%34 = phi i32 [ %30, %29 ], [ %32, %31 ]
store i32 %34, i32* %5
%35 = load i32, i32* %4
%36 = load i32, i32* %6
%37 = icmp sgt i32 %35, %36
br i1 %37, label %38, label %40
38: ; preds = %33
%39 = load i32, i32* %4
br label %42
40: ; preds = %33
%41 = load i32, i32* %6
br label %42
42: ; preds = %40, %38
%43 = phi i32 [ %39, %38 ], [ %41, %40 ]
store i32 %43, i32* %6
%44 = load i32*, i32** %2
%45 = call i32 @fscanf(i32* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%46 = load i32, i32* %4
%47 = load i32, i32* %7
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %51
49: ; preds = %42
%50 = load i32, i32* %4
br label %53
51: ; preds = %42
%52 = load i32, i32* %7
br label %53
53: ; preds = %51, %49
%54 = phi i32 [ %50, %49 ], [ %52, %51 ]
store i32 %54, i32* %7
%55 = load i32, i32* %4
%56 = load i32, i32* %8
%57 = icmp sgt i32 %55, %56
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = load i32, i32* %4
br label %62
60: ; preds = %53
%61 = load i32, i32* %8
br label %62
62: ; preds = %60, %58
%63 = phi i32 [ %59, %58 ], [ %61, %60 ]
store i32 %63, i32* %8
br label %64
64: ; preds = %62
%65 = load i32, i32* %3
%66 = add nsw i32 %65, -1
store i32 %66, i32* %3
br label %20
67: ; preds = %20
%68 = load i32*, i32** %2
%69 = call i32 @fclose(i32* %68)
%70 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %70, i32** %2
%71 = load i32*, i32** %2
%72 = load i32, i32* %6
%73 = load i32, i32* %5
%74 = sub nsw i32 %72, %73
%75 = load i32, i32* %8
%76 = load i32, i32* %7
%77 = sub nsw i32 %75, %76
%78 = icmp sgt i32 %74, %77
br i1 %78, label %79, label %83
79: ; preds = %67
%80 = load i32, i32* %6
%81 = load i32, i32* %5
%82 = sub nsw i32 %80, %81
br label %87
83: ; preds = %67
%84 = load i32, i32* %8
%85 = load i32, i32* %7
%86 = sub nsw i32 %84, %85
br label %87
87: ; preds = %83, %79
%88 = phi i32 [ %82, %79 ], [ %86, %83 ]
%89 = call i32 @fprintf(i32* %71, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %88)
%90 = load i32*, i32** %2
%91 = call i32 @fclose(i32* %90)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [8 x i8] c"OUT.TXT\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = add nsw i32 %11, -1
store i32 %12, i32* %1
%13 = icmp eq i32 %12, 0
br i1 %13, label %34, label %14
14: ; preds = %0, %14
%15 = phi i32 [ %30, %14 ], [ %10, %0 ]
%16 = phi i32 [ %28, %14 ], [ %10, %0 ]
%17 = phi i32 [ %24, %14 ], [ %8, %0 ]
%18 = phi i32 [ %22, %14 ], [ %8, %0 ]
%19 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, %18
%22 = select i1 %21, i32 %20, i32 %18
%23 = icmp sgt i32 %20, %17
%24 = select i1 %23, i32 %20, i32 %17
%25 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, %16
%28 = select i1 %27, i32 %26, i32 %16
%29 = icmp sgt i32 %26, %15
%30 = select i1 %29, i32 %26, i32 %15
%31 = load i32, i32* %1
%32 = add nsw i32 %31, -1
store i32 %32, i32* %1
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %14
34: ; preds = %14, %0
%35 = phi i32 [ %8, %0 ], [ %22, %14 ]
%36 = phi i32 [ %8, %0 ], [ %24, %14 ]
%37 = phi i32 [ %10, %0 ], [ %28, %14 ]
%38 = phi i32 [ %10, %0 ], [ %30, %14 ]
%39 = call i32 @fclose(i32* %3)
%40 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%41 = sub nsw i32 %36, %35
%42 = sub nsw i32 %38, %37
%43 = icmp sgt i32 %41, %42
%44 = select i1 %43, i32 %41, i32 %42
%45 = call i32 @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %44)
%46 = call i32 @fclose(i32* %40)
ret i32 0
}