program ABC114B
    implicit none
    integer(8)::i,N
    integer(8)::X
    integer(8)::diff_min
    character(10)::S

    read(5,*)S
    N=len_trim(S)

    do i=1,N-2
        read(S(i:i+2),*)X
        if(i==1 .or. abs(X-753)<diff_min)then
            diff_min=abs(X-753)
        end if
    end do

    print'(i0)',diff_min
end program ABC114B
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QQcl.2c383e1671a70b342fb33d519252b5d7 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5334/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca [10 x i8], align 1
  %2 = alloca i64, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.2c383e1671a70b342fb33d519252b5d7, i32 8)
  %4 = call i1 @_FortranAioInputAscii(ptr %3, ptr nonnull %1, i64 10)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  br label %6

6:                                                ; preds = %0, %6
  %7 = phi i64 [ 9, %0 ], [ %11, %6 ]
  %8 = getelementptr [10 x [1 x i8]], ptr %1, i64 0, i64 %7
  %9 = load i8, ptr %8, align 1, !tbaa !3
  %10 = icmp eq i8 %9, 32
  %11 = add nsw i64 %7, -1
  %12 = icmp ne i64 %7, 0
  %13 = and i1 %10, %12
  br i1 %13, label %6, label %14

14:                                               ; preds = %6
  %15 = shl i64 %7, 32
  %sext = add i64 %15, 4294967296
  %16 = ashr exact i64 %sext, 32
  %.op = add nsw i64 %16, -2
  %spec.select8 = select i1 %10, i64 -2, i64 %.op
  %17 = icmp sgt i64 %spec.select8, 0
  br i1 %17, label %select.unfold, label %select.unfold._crit_edge

select.unfold:                                    ; preds = %14, %select.unfold
  %18 = phi i64 [ %32, %select.unfold ], [ 1, %14 ]
  %.010 = phi i64 [ %spec.select, %select.unfold ], [ undef, %14 ]
  %19 = add nsw i64 %18, -1
  %20 = getelementptr [10 x [1 x i8]], ptr %1, i64 0, i64 %19
  %21 = call ptr @_FortranAioBeginInternalListInput(ptr %20, i64 3, ptr null, i64 0, ptr nonnull @_QQcl.2c383e1671a70b342fb33d519252b5d7, i32 12)
  %22 = call i1 @_FortranAioInputInteger(ptr %21, ptr nonnull %2, i32 8)
  %23 = call i32 @_FortranAioEndIoStatement(ptr %21)
  %24 = icmp eq i64 %18, 1
  %25 = load i64, ptr %2, align 8, !tbaa !3
  %26 = add i64 %25, -753
  %27 = icmp slt i64 %26, 0
  %28 = sub i64 753, %25
  %29 = select i1 %27, i64 %28, i64 %26
  %30 = icmp slt i64 %29, %.010
  %31 = or i1 %24, %30
  %spec.select = select i1 %31, i64 %29, i64 %.010
  %32 = add nuw nsw i64 %18, 1
  %exitcond.not = icmp eq i64 %18, %spec.select8
  br i1 %exitcond.not, label %select.unfold._crit_edge, label %select.unfold

select.unfold._crit_edge:                         ; preds = %select.unfold, %14
  %.0.lcssa = phi i64 [ undef, %14 ], [ %spec.select, %select.unfold ]
  %33 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.2c383e1671a70b342fb33d519252b5d7, i32 18)
  %34 = call i1 @_FortranAioOutputInteger64(ptr %33, i64 %.0.lcssa)
  %35 = call i32 @_FortranAioEndIoStatement(ptr %33)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginInternalListInput(ptr, i64, ptr, i64, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
