program main
	implicit none
    character(1000) S, ans
	integer w, i
	read(*, *) S
	read(*, *) w
	do i = 1, len_trim(S)
		if(w == 1) then
			write(*, *) trim(S)
			goto 1
		else if(mod(i,w) == 1) then
			write(*, '(a)', advance = 'No') S(i:i)
		end if
	end do
	write(*, *) ''
1 continue
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"

@_QFEs = internal global [1000 x i8] undef
@_QQcl.9550379ae6da145268fb28ba8207919b = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5764/source.f\00"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_QQcl. = linkonce constant [0 x i8] zeroinitializer
@_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 i32, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.9550379ae6da145268fb28ba8207919b, i32 5)
  %5 = tail call i1 @_FortranAioInputAscii(ptr %4, ptr nonnull @_QFEs, i64 1000)
  %6 = tail call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.9550379ae6da145268fb28ba8207919b, i32 6)
  %8 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %3, i32 4)
  %9 = call i32 @_FortranAioEndIoStatement(ptr %7)
  br label %10

10:                                               ; preds = %0, %10
  %11 = phi i64 [ 999, %0 ], [ %15, %10 ]
  %12 = getelementptr [1000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !3
  %14 = icmp eq i8 %13, 32
  %15 = add nsw i64 %11, -1
  %16 = icmp ne i64 %11, 0
  %17 = and i1 %14, %16
  br i1 %17, label %10, label %18

18:                                               ; preds = %10
  %19 = trunc i64 %11 to i32
  %20 = add i32 %19, 1
  %spec.select = select i1 %14, i32 0, i32 %20
  %21 = icmp sgt i32 %spec.select, 0
  br i1 %21, label %.lr.ph.preheader, label %select.unfold._crit_edge

.lr.ph.preheader:                                 ; preds = %18
  %22 = add nuw i32 %spec.select, 1
  %wide.trip.count = zext i32 %22 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %select.unfold
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %select.unfold ]
  %23 = load i32, ptr %3, align 4, !tbaa !3
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %29

25:                                               ; preds = %.lr.ph
  %26 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.9550379ae6da145268fb28ba8207919b, i32 9)
  store ptr @_QFEs, ptr %1, align 8, !tbaa !7
  %.fca.1.gep13 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 1000, ptr %.fca.1.gep13, align 8, !tbaa !7
  %.fca.2.gep14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep14, align 8, !tbaa !7
  %.fca.3.gep15 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep15, align 4, !tbaa !7
  %.fca.4.gep16 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep16, align 1, !tbaa !7
  %.fca.5.gep17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep17, align 2, !tbaa !7
  %.fca.6.gep18 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep18, align 1, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %27 = call {} @_FortranATrim(ptr nonnull %2, ptr nonnull %1, ptr nonnull @_QQcl.9550379ae6da145268fb28ba8207919b, i32 9)
  %.fca.0.load = load ptr, ptr %2, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  %28 = call i1 @_FortranAioOutputAscii(ptr %26, ptr %.fca.0.load, i64 %.fca.1.load)
  call void @free(ptr %.fca.0.load)
  br label %42

29:                                               ; preds = %.lr.ph
  %30 = trunc i64 %indvars.iv to i32
  %31 = srem i32 %30, %23
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %33, label %select.unfold

33:                                               ; preds = %29
  %34 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.9550379ae6da145268fb28ba8207919b, i32 12)
  %35 = call i1 @_FortranAioSetAdvance(ptr %34, ptr nonnull @_QQcl.4E6F, i64 2)
  %36 = add nsw i64 %indvars.iv, -1
  %37 = getelementptr [1000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %36
  %38 = call i1 @_FortranAioOutputAscii(ptr %34, ptr %37, i64 1)
  %39 = call i32 @_FortranAioEndIoStatement(ptr %34)
  br label %select.unfold

select.unfold:                                    ; preds = %33, %29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %select.unfold._crit_edge, label %.lr.ph

select.unfold._crit_edge:                         ; preds = %select.unfold, %18
  %40 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.9550379ae6da145268fb28ba8207919b, i32 15)
  %41 = call i1 @_FortranAioOutputAscii(ptr %40, ptr nonnull @_QQcl., i64 0)
  br label %42

42:                                               ; preds = %25, %select.unfold._crit_edge
  %.sink = phi ptr [ %26, %25 ], [ %40, %select.unfold._crit_edge ]
  %43 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  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 i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

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

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

declare {} @_FortranATrim(ptr, ptr, ptr, i32) local_unnamed_addr

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

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

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

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { 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}
