integer(16) N,comb(1:600),cnt(1:600)
character(5000) ans
read*,N
comb(1)=1
do i = 2,600
  comb(i) = comb(i-1)* (i+6) / (i-1)
end do
do i=600,1,-1
  cnt(i) = N / comb(i)
  N =mod(N,comb(i))
end do

ans=""
do i=1,600
  ans=trim(ans)//"FESTIVA"//repeat("L",cnt(i))
end do
print"(A)",trim(ans)
end
; 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"

@_QFEans = internal global [5000 x i8] undef
@_QFEcnt = internal unnamed_addr global [600 x i128] undef
@_QFEcomb = internal unnamed_addr global [600 x i128] undef
@_QQcl.216b21eb41adf3b6bbf4be8a37323344 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7726/source.f\00"
@_QQcl.46455354495641 = linkonce local_unnamed_addr constant [7 x i8] c"FESTIVA"
@_QQcl.4C = linkonce constant [1 x i8] c"L"
@_QQcl.284129 = linkonce constant [3 x i8] c"(A)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %6 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %7 = alloca i128, align 8
  %8 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.216b21eb41adf3b6bbf4be8a37323344, i32 3)
  %9 = call i1 @_FortranAioInputInteger(ptr %8, ptr nonnull %7, i32 16)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %8)
  store i128 1, ptr @_QFEcomb, align 16, !tbaa !3
  br label %11

.preheader218:                                    ; preds = %11
  %.promoted = load i128, ptr %7, align 8, !tbaa !3
  br label %27

11:                                               ; preds = %20, %0
  %12 = phi i128 [ 1, %0 ], [ %25, %20 ]
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next.1, %20 ]
  %13 = add nsw i64 %indvars.iv, -1
  %14 = add nuw nsw i64 %indvars.iv, 6
  %15 = zext i64 %14 to i128
  %16 = mul i128 %12, %15
  %17 = sext i64 %13 to i128
  %18 = sdiv i128 %16, %17
  %19 = getelementptr [600 x i128], ptr @_QFEcomb, i64 0, i64 %13
  store i128 %18, ptr %19, align 16, !tbaa !3
  %exitcond.not = icmp eq i64 %indvars.iv, 600
  br i1 %exitcond.not, label %.preheader218, label %20

20:                                               ; preds = %11
  %21 = add nuw nsw i64 %indvars.iv, 7
  %22 = zext i64 %21 to i128
  %23 = mul i128 %18, %22
  %24 = zext i64 %indvars.iv to i128
  %25 = sdiv i128 %23, %24
  %26 = getelementptr [600 x i128], ptr @_QFEcomb, i64 0, i64 %indvars.iv
  store i128 %25, ptr %26, align 16, !tbaa !3
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  br label %11

.preheader217:                                    ; preds = %27
  store i128 %.decomposed, ptr %7, align 8, !tbaa !3
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5000) @_QFEans, i8 32, i64 5000, i1 false), !tbaa !3
  %.fca.1.gep125 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %.fca.2.gep126 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  %.fca.3.gep127 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  %.fca.4.gep128 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  %.fca.5.gep129 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  %.fca.6.gep130 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 6
  %.fca.1.gep197 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  %.fca.2.gep198 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  %.fca.3.gep199 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  %.fca.4.gep200 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  %.fca.5.gep201 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  %.fca.6.gep202 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  %.fca.1.gep17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 1
  %.fca.2.gep19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 2
  %.fca.3.gep21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 3
  %.fca.4.gep23 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 4
  %.fca.5.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 5
  %.fca.6.gep27 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 6
  br label %37

27:                                               ; preds = %.preheader218, %27
  %28 = phi i64 [ 600, %.preheader218 ], [ %30, %27 ]
  %29 = phi i128 [ %.promoted, %.preheader218 ], [ %.decomposed, %27 ]
  %30 = add nsw i64 %28, -1
  %31 = getelementptr [600 x i128], ptr @_QFEcomb, i64 0, i64 %30
  %32 = load i128, ptr %31, align 16, !tbaa !3
  %.frozen = freeze i128 %29
  %.frozen231 = freeze i128 %32
  %33 = sdiv i128 %.frozen, %.frozen231
  %34 = getelementptr [600 x i128], ptr @_QFEcnt, i64 0, i64 %30
  store i128 %33, ptr %34, align 16, !tbaa !3
  %35 = mul i128 %33, %.frozen231
  %.decomposed = sub i128 %.frozen, %35
  %36 = icmp ugt i64 %28, 1
  br i1 %36, label %27, label %.preheader217

37:                                               ; preds = %.preheader217, %._crit_edge221
  %indvars.iv227 = phi i64 [ 1, %.preheader217 ], [ %indvars.iv.next228, %._crit_edge221 ]
  store ptr @_QFEans, ptr %2, align 8, !tbaa !7
  store i64 5000, ptr %.fca.1.gep125, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep126, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep127, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep128, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep129, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep130, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %38 = call {} @_FortranATrim(ptr nonnull %6, ptr nonnull %2, ptr nonnull @_QQcl.216b21eb41adf3b6bbf4be8a37323344, i32 15)
  %.fca.0.load = load ptr, ptr %6, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  %39 = add i64 %.fca.1.load, 7
  %40 = alloca i8, i64 %39, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %40, ptr align 1 %.fca.0.load, i64 %.fca.1.load, i1 false)
  %uglygep = getelementptr i8, ptr %40, i64 %.fca.1.load
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %uglygep, ptr noundef nonnull align 1 dereferenceable(7) @_QQcl.46455354495641, i64 7, i1 false), !tbaa !3
  %41 = add nsw i64 %indvars.iv227, -1
  %42 = getelementptr [600 x i128], ptr @_QFEcnt, i64 0, i64 %41
  %43 = load i128, ptr %42, align 16, !tbaa !3
  %44 = trunc i128 %43 to i64
  store ptr @_QQcl.4C, ptr %1, align 8, !tbaa !7
  store i64 1, ptr %.fca.1.gep197, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep198, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep199, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep200, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep201, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep202, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep19, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep21, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep23, align 1, !tbaa !7
  store i8 2, ptr %.fca.5.gep25, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep27, align 1, !tbaa !7
  %45 = call {} @_FortranARepeat(ptr nonnull %5, ptr nonnull %1, i64 %44, ptr nonnull @_QQcl.216b21eb41adf3b6bbf4be8a37323344, i32 15)
  %.fca.0.load29 = load ptr, ptr %5, align 8, !tbaa !7
  %.fca.1.load32 = load i64, ptr %.fca.1.gep17, align 8, !tbaa !7
  %46 = add i64 %.fca.1.load32, %39
  %47 = alloca i8, i64 %46, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %47, ptr nonnull align 1 %40, i64 %39, i1 false)
  %48 = icmp sgt i64 %.fca.1.load32, 0
  br i1 %48, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %37
  %uglygep224 = getelementptr i8, ptr %47, i64 7
  %uglygep225 = getelementptr i8, ptr %uglygep224, i64 %.fca.1.load
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %uglygep225, ptr align 1 %.fca.0.load29, i64 %.fca.1.load32, i1 false), !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %37
  %49 = call i64 @llvm.smin.i64(i64 %46, i64 5000)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @_QFEans, ptr nonnull align 1 %47, i64 %49, i1 false)
  %50 = sub i64 5000, %49
  %51 = icmp sgt i64 %50, 0
  br i1 %51, label %.lr.ph220.preheader, label %._crit_edge221

.lr.ph220.preheader:                              ; preds = %._crit_edge
  %uglygep226 = getelementptr i8, ptr @_QFEans, i64 %49
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep226, i8 32, i64 %50, i1 false), !tbaa !3
  br label %._crit_edge221

._crit_edge221:                                   ; preds = %.lr.ph220.preheader, %._crit_edge
  call void @free(ptr %.fca.0.load29)
  call void @free(ptr %.fca.0.load)
  %indvars.iv.next228 = add nuw nsw i64 %indvars.iv227, 1
  %exitcond230.not = icmp eq i64 %indvars.iv.next228, 601
  br i1 %exitcond230.not, label %52, label %37

52:                                               ; preds = %._crit_edge221
  %53 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.216b21eb41adf3b6bbf4be8a37323344, i32 17)
  store ptr @_QFEans, ptr %3, align 8, !tbaa !7
  %.fca.1.gep85 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 1
  store i64 5000, ptr %.fca.1.gep85, align 8, !tbaa !7
  %.fca.2.gep86 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep86, align 8, !tbaa !7
  %.fca.3.gep87 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep87, align 4, !tbaa !7
  %.fca.4.gep88 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep88, align 1, !tbaa !7
  %.fca.5.gep89 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep89, align 2, !tbaa !7
  %.fca.6.gep90 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep90, align 1, !tbaa !7
  %.fca.1.gep52 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 1
  %.fca.2.gep54 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep54, align 8, !tbaa !7
  %.fca.3.gep56 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep56, align 4, !tbaa !7
  %.fca.4.gep58 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep58, align 1, !tbaa !7
  %.fca.5.gep60 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep60, align 2, !tbaa !7
  %.fca.6.gep62 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep62, align 1, !tbaa !7
  %54 = call {} @_FortranATrim(ptr nonnull %4, ptr nonnull %3, ptr nonnull @_QQcl.216b21eb41adf3b6bbf4be8a37323344, i32 17)
  %.fca.0.load64 = load ptr, ptr %4, align 8, !tbaa !7
  %.fca.1.load67 = load i64, ptr %.fca.1.gep52, align 8, !tbaa !7
  %55 = call i1 @_FortranAioOutputAscii(ptr %53, ptr %.fca.0.load64, i64 %.fca.1.load67)
  call void @free(ptr %.fca.0.load64)
  %56 = call i32 @_FortranAioEndIoStatement(ptr %53)
  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 {} @_FortranATrim(ptr, ptr, ptr, i32) local_unnamed_addr

declare {} @_FortranARepeat(ptr, ptr, i64, ptr, i32) local_unnamed_addr

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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