program main
  implicit none
  integer :: n, x, y, i, j, dist, k
  integer, allocatable :: cnt(:)
  read (*, *) n, x, y
  allocate (cnt(n - 1))
  cnt(:) = 0
  do i = 1, n - 1
    do j = i + 1, n
      dist = j - i
      dist = min(dist, abs(j - y) + abs(i - x) + 1)
      dist = min(dist, abs(j - x) + abs(i - y) + 1)
      cnt(dist) = cnt(dist) + 1
    end do
  end do

  do k = 1, n - 1
    write (*, "(i0)") cnt(k)
  end do
end program main

; 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"

@_QFEcnt.0 = internal unnamed_addr global ptr null
@_QQcl.aa9cf28b2b76efe07ef622dd3e1f080f = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1985/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.aa9cf28b2b76efe07ef622dd3e1f080f, i32 5)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %1, i32 4)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 4)
  %7 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 4)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %9 = load i32, ptr %1, align 4, !tbaa !3
  %10 = add i32 %9, -1
  %11 = call i32 @llvm.smax.i32(i32 %10, i32 0)
  %12 = zext i32 %11 to i64
  %13 = shl nuw nsw i64 %12, 2
  %14 = call ptr @malloc(i64 %13)
  store ptr %14, ptr @_QFEcnt.0, align 8, !tbaa !7
  %.not = icmp slt i32 %10, 1
  br i1 %.not, label %._crit_edge120, label %.lr.ph118

.lr.ph118:                                        ; preds = %0
  %15 = shl nuw nsw i64 %12, 2
  call void @llvm.memset.p0.i64(ptr align 4 %14, i8 0, i64 %15, i1 false), !tbaa !3
  %16 = zext i32 %10 to i64
  %17 = sext i32 %9 to i64
  %18 = load i32, ptr %3, align 4
  %19 = load i32, ptr %2, align 4
  br label %20

20:                                               ; preds = %.lr.ph118, %._crit_edge
  %indvars.iv = phi i64 [ 1, %.lr.ph118 ], [ %indvars.iv.next, %._crit_edge ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %sext = shl i64 %indvars.iv.next, 32
  %21 = ashr exact i64 %sext, 32
  %22 = sub nsw i64 1, %21
  %23 = add nsw i64 %22, %17
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph116, label %._crit_edge

.lr.ph116:                                        ; preds = %20
  %25 = trunc i64 %indvars.iv.next to i32
  %26 = trunc i64 %indvars.iv to i32
  %27 = sub i32 %26, %19
  %28 = call i32 @llvm.abs.i32(i32 %27, i1 false)
  %29 = sub i32 %26, %18
  %30 = call i32 @llvm.abs.i32(i32 %29, i1 false)
  %31 = add nuw i32 %30, 1
  br label %32

32:                                               ; preds = %.lr.ph116, %32
  %33 = phi i64 [ %23, %.lr.ph116 ], [ %51, %32 ]
  %34 = phi i32 [ %25, %.lr.ph116 ], [ %50, %32 ]
  %35 = sub i32 %34, %26
  %36 = sub i32 %34, %18
  %37 = call i32 @llvm.abs.i32(i32 %36, i1 false)
  %38 = add nuw i32 %37, 1
  %39 = add i32 %38, %28
  %40 = call i32 @llvm.smin.i32(i32 %35, i32 %39)
  %41 = sub i32 %34, %19
  %42 = call i32 @llvm.abs.i32(i32 %41, i1 false)
  %43 = add i32 %31, %42
  %44 = call i32 @llvm.smin.i32(i32 %40, i32 %43)
  %45 = sext i32 %44 to i64
  %46 = add nsw i64 %45, -1
  %47 = getelementptr i32, ptr %14, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !3
  %49 = add i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !3
  %50 = add i32 %34, 1
  %51 = add nsw i64 %33, -1
  %52 = icmp ugt i64 %33, 1
  br i1 %52, label %32, label %._crit_edge

._crit_edge:                                      ; preds = %32, %20
  %exitcond.not = icmp eq i64 %indvars.iv, %16
  br i1 %exitcond.not, label %.lr.ph119, label %20

.lr.ph119:                                        ; preds = %._crit_edge, %.lr.ph119
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %.lr.ph119 ], [ 1, %._crit_edge ]
  %53 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.aa9cf28b2b76efe07ef622dd3e1f080f, i32 18)
  %.unpack = load ptr, ptr @_QFEcnt.0, align 8, !tbaa !7
  %54 = add nsw i64 %indvars.iv123, -1
  %55 = getelementptr i32, ptr %.unpack, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !3
  %57 = call i1 @_FortranAioOutputInteger32(ptr %53, i32 %56)
  %58 = call i32 @_FortranAioEndIoStatement(ptr %53)
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond126.not = icmp eq i64 %indvars.iv123, %16
  br i1 %exitcond126.not, label %._crit_edge120, label %.lr.ph119

._crit_edge120:                                   ; preds = %.lr.ph119, %0
  ret void
}

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

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

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
