program lisdl
  implicit none
  integer(8) :: n, a, b, h, p, s, i, j
  read(*,*) n, a, b
  if ((a+b.gt.n+1_8).or.(a*b.lt.n)) then
    write(*,'(i0)') -1
    stop
  end if
  write(*,'(i0)',advance='no') b
  do i = b-1_8, 1_8, -1_8
    write(*,'(x,i0)',advance='no') i
  end do
  h = n-a-b+1_8
  p = b+1_8
  do i = 0_8, a-2_8, 1_8
    s = min(h,b-1_8)+1_8
    h = h-s+1_8
    do j = p+s-1_8, p, -1_8
      write(*,'(x,i0)',advance='no') j
    end do
    p = p+s
  end do
  write(*,*)
  stop
end program lisdl
; 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.7545828dd987c1defc1f1d64ce11766d = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6190/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQcl.6E6F = linkonce constant [2 x i8] c"no"
@_QQcl.28782C693029 = linkonce constant [6 x i8] c"(x,i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.7545828dd987c1defc1f1d64ce11766d, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 8)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %1, i32 8)
  %7 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 8)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %9 = load i64, ptr %1, align 8, !tbaa !3
  %10 = load i64, ptr %2, align 8, !tbaa !3
  %11 = add i64 %10, %9
  %12 = load i64, ptr %3, align 8, !tbaa !3
  %13 = add i64 %12, 1
  %14 = icmp sgt i64 %11, %13
  %15 = mul i64 %10, %9
  %16 = icmp slt i64 %15, %12
  %17 = or i1 %16, %14
  br i1 %17, label %18, label %23

18:                                               ; preds = %0
  %19 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.7545828dd987c1defc1f1d64ce11766d, i32 6)
  %20 = call i1 @_FortranAioOutputInteger32(ptr %19, i32 -1)
  %21 = call i32 @_FortranAioEndIoStatement(ptr %19)
  %22 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

23:                                               ; preds = %0
  %24 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.7545828dd987c1defc1f1d64ce11766d, i32 9)
  %25 = call i1 @_FortranAioSetAdvance(ptr %24, ptr nonnull @_QQcl.6E6F, i64 2)
  %26 = load i64, ptr %2, align 8, !tbaa !3
  %27 = call i1 @_FortranAioOutputInteger64(ptr %24, i64 %26)
  %28 = call i32 @_FortranAioEndIoStatement(ptr %24)
  %29 = load i64, ptr %2, align 8, !tbaa !3
  %30 = add i64 %29, -1
  %31 = icmp sgt i64 %30, 0
  br i1 %31, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %23, %.lr.ph
  %32 = phi i64 [ %38, %.lr.ph ], [ %30, %23 ]
  %.in21 = phi i64 [ %33, %.lr.ph ], [ %29, %23 ]
  %33 = add i64 %.in21, -1
  %34 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28782C693029, i64 6, ptr null, i32 -1, ptr nonnull @_QQcl.7545828dd987c1defc1f1d64ce11766d, i32 11)
  %35 = call i1 @_FortranAioSetAdvance(ptr %34, ptr nonnull @_QQcl.6E6F, i64 2)
  %36 = call i1 @_FortranAioOutputInteger64(ptr %34, i64 %33)
  %37 = call i32 @_FortranAioEndIoStatement(ptr %34)
  %38 = add nsw i64 %32, -1
  %.not = icmp eq i64 %38, 0
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr %2, align 8, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %23
  %39 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %29, %23 ]
  %40 = load i64, ptr %1, align 8, !tbaa !3
  %41 = add i64 %40, -1
  %42 = icmp sgt i64 %41, 0
  br i1 %42, label %.lr.ph27.preheader, label %._crit_edge28

.lr.ph27.preheader:                               ; preds = %._crit_edge
  %43 = add i64 %39, 1
  %44 = load i64, ptr %3, align 8, !tbaa !3
  %45 = add i64 %40, %39
  %46 = sub i64 %44, %45
  br label %.lr.ph27

.loopexit:                                        ; preds = %.lr.ph23, %.lr.ph27
  %47 = add i64 %49, -1
  %48 = icmp sgt i64 %47, 0
  br i1 %48, label %.lr.ph27, label %._crit_edge28

.lr.ph27:                                         ; preds = %.lr.ph27.preheader, %.loopexit
  %49 = phi i64 [ %47, %.loopexit ], [ %41, %.lr.ph27.preheader ]
  %.0.in25 = phi i64 [ %54, %.loopexit ], [ %46, %.lr.ph27.preheader ]
  %.01224 = phi i64 [ %55, %.loopexit ], [ %43, %.lr.ph27.preheader ]
  %.0 = add i64 %.0.in25, 1
  %50 = load i64, ptr %2, align 8, !tbaa !3
  %51 = add i64 %50, -1
  %52 = call i64 @llvm.smin.i64(i64 %.0, i64 %51)
  %53 = add i64 %52, 1
  %54 = sub i64 %.0, %53
  %55 = add i64 %53, %.01224
  %56 = icmp ult i64 %52, 9223372036854775807
  br i1 %56, label %.lr.ph23.preheader, label %.loopexit

.lr.ph23.preheader:                               ; preds = %.lr.ph27
  %57 = add i64 %52, %.01224
  br label %.lr.ph23

.lr.ph23:                                         ; preds = %.lr.ph23.preheader, %.lr.ph23
  %58 = phi i64 [ %65, %.lr.ph23 ], [ %53, %.lr.ph23.preheader ]
  %59 = phi i64 [ %64, %.lr.ph23 ], [ %57, %.lr.ph23.preheader ]
  %60 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28782C693029, i64 6, ptr null, i32 -1, ptr nonnull @_QQcl.7545828dd987c1defc1f1d64ce11766d, i32 19)
  %61 = call i1 @_FortranAioSetAdvance(ptr %60, ptr nonnull @_QQcl.6E6F, i64 2)
  %62 = call i1 @_FortranAioOutputInteger64(ptr %60, i64 %59)
  %63 = call i32 @_FortranAioEndIoStatement(ptr %60)
  %64 = add i64 %59, -1
  %65 = add nsw i64 %58, -1
  %66 = icmp ugt i64 %58, 1
  br i1 %66, label %.lr.ph23, label %.loopexit

._crit_edge28:                                    ; preds = %.loopexit, %._crit_edge
  %67 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.7545828dd987c1defc1f1d64ce11766d, i32 23)
  %68 = call i32 @_FortranAioEndIoStatement(ptr %67)
  %69 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

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

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

attributes #0 = { noreturn }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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"}
