program main
  implicit none
  integer :: n, i, begin, even, odd, i_atr
  logical :: rtol
  character(100000) :: s
  integer, allocatable :: res(:)
  read (*, *) s
  n = len_trim(s)
  allocate (res(n))
  res(:) = 0

  begin = 1
  rtol = .false.
  do i = 2, n + 1
    if (i == n + 1 .or. (s(i:i) == "R" .and. rtol)) then
      ! 区間 [begin, i - 1] が1つのbasin. そのbasinに対する処理
      even = (i - 1) / 2 - (begin - 1) / 2
      odd = (i - begin) - even
      if (mod(i_atr, 2) == 0) then
        res(i_atr) = even
        res(i_atr + 1) = odd
      else
        res(i_atr) = odd
        res(i_atr + 1) = even
      end if

      ! 次のbasinのための処理
      begin = i
      rtol = .false.
    else if (s(i:i) == "L") then
      if (.not. rtol) then
        i_atr = i - 1
        rtol = .true.
      end if
    end if
  end do

  write (*, "(100000(i0, ' '))") res(:)
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"

@_QFEres.0 = internal unnamed_addr global ptr null
@_QFEres.8 = internal unnamed_addr global i64 0
@_QFEs = internal global [100000 x i8] undef
@_QQcl.c3d43104955026c6bbd071184c040d91 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3612/source.f\00"
@_QQcl.52 = linkonce constant [1 x i8] c"R"
@_QQcl.4C = linkonce constant [1 x i8] c"L"
@_QQcl.283130303030302869302C202720272929 = linkonce constant [17 x i8] c"(100000(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 { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.c3d43104955026c6bbd071184c040d91, i32 7)
  %3 = tail call i1 @_FortranAioInputAscii(ptr %2, ptr nonnull @_QFEs, i64 100000)
  %4 = tail call i32 @_FortranAioEndIoStatement(ptr %2)
  br label %5

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

13:                                               ; preds = %5
  %14 = trunc i64 %6 to i32
  %15 = add i32 %14, 1
  %16 = select i1 %9, i32 0, i32 %15
  %17 = tail call i32 @llvm.smax.i32(i32 %16, i32 0)
  %18 = zext i32 %17 to i64
  %19 = shl nuw nsw i64 %18, 2
  %20 = tail call ptr @malloc(i64 %19)
  store ptr %20, ptr @_QFEres.0, align 8, !tbaa !7
  store i64 %18, ptr @_QFEres.8, align 8, !tbaa !7
  %.not = icmp slt i32 %16, 1
  br i1 %.not, label %._crit_edge, label %select.unfold._crit_edge

select.unfold._crit_edge:                         ; preds = %13
  %21 = shl nuw nsw i64 %18, 2
  tail call void @llvm.memset.p0.i64(ptr align 4 %20, i8 0, i64 %21, i1 false), !tbaa !3
  %22 = add nuw i32 %16, 1
  %23 = icmp sgt i32 %22, 1
  br i1 %23, label %.lr.ph285.preheader, label %._crit_edge

.lr.ph285.preheader:                              ; preds = %select.unfold._crit_edge
  %24 = zext i32 %22 to i64
  %25 = zext i32 %22 to i64
  br label %.lr.ph285

.lr.ph285:                                        ; preds = %.lr.ph285.preheader, %57
  %indvars.iv = phi i64 [ 2, %.lr.ph285.preheader ], [ %indvars.iv.next, %57 ]
  %.0284 = phi i32 [ 0, %.lr.ph285.preheader ], [ %.1, %57 ]
  %.0201283 = phi i32 [ 1, %.lr.ph285.preheader ], [ %.1202, %57 ]
  %.0203282 = phi i32 [ undef, %.lr.ph285.preheader ], [ %.1204, %57 ]
  %26 = icmp eq i64 %indvars.iv, %25
  %27 = add nsw i64 %indvars.iv, -1
  %28 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %27
  %29 = tail call i32 @_FortranACharacterCompareScalar1(ptr %28, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %30 = icmp eq i32 %29, 0
  %31 = icmp ne i32 %.0284, 0
  %32 = and i1 %31, %30
  %33 = or i1 %26, %32
  br i1 %33, label %34, label %52

34:                                               ; preds = %.lr.ph285
  %35 = trunc i64 %27 to i32
  %.udiv290 = lshr i32 %35, 1
  %36 = add i32 %.0201283, -1
  %.neg = sdiv i32 %36, -2
  %37 = add nsw i32 %.udiv290, %.neg
  %38 = add i32 %.0201283, %37
  %39 = trunc i64 %indvars.iv to i32
  %40 = sub i32 %39, %38
  %41 = and i32 %.0203282, 1
  %42 = icmp eq i32 %41, 0
  %.unpack253 = load ptr, ptr @_QFEres.0, align 8, !tbaa !7
  %43 = sext i32 %.0203282 to i64
  %44 = add nsw i64 %43, -1
  %45 = getelementptr i32, ptr %.unpack253, i64 %44
  %46 = add i32 %.0203282, 1
  %47 = sext i32 %46 to i64
  %48 = add nsw i64 %47, -1
  %49 = getelementptr i32, ptr %.unpack253, i64 %48
  br i1 %42, label %50, label %51

50:                                               ; preds = %34
  store i32 %37, ptr %45, align 4, !tbaa !3
  store i32 %40, ptr %49, align 4, !tbaa !3
  br label %57

51:                                               ; preds = %34
  store i32 %40, ptr %45, align 4, !tbaa !3
  store i32 %37, ptr %49, align 4, !tbaa !3
  br label %57

52:                                               ; preds = %.lr.ph285
  %53 = tail call i32 @_FortranACharacterCompareScalar1(ptr %28, ptr nonnull @_QQcl.4C, i64 1, i64 1)
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %57

55:                                               ; preds = %52
  %56 = trunc i64 %27 to i32
  %spec.select = select i1 %31, i32 %.0203282, i32 %56
  %spec.select277 = select i1 %31, i32 %.0284, i32 1
  br label %57

57:                                               ; preds = %55, %51, %50, %52
  %.1204 = phi i32 [ %.0203282, %52 ], [ %.0203282, %50 ], [ %.0203282, %51 ], [ %spec.select, %55 ]
  %.1202 = phi i32 [ %.0201283, %52 ], [ %39, %50 ], [ %39, %51 ], [ %.0201283, %55 ]
  %.1 = phi i32 [ %.0284, %52 ], [ 0, %50 ], [ 0, %51 ], [ %spec.select277, %55 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %24
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph285

._crit_edge:                                      ; preds = %57, %13, %select.unfold._crit_edge
  %58 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.283130303030302869302C202720272929, i64 17, ptr null, i32 -1, ptr nonnull @_QQcl.c3d43104955026c6bbd071184c040d91, i32 38)
  %.unpack = load ptr, ptr @_QFEres.0, align 8, !tbaa !7
  %.unpack224.unpack.unpack226 = load i64, ptr @_QFEres.8, align 8, !tbaa !7
  %59 = tail call i64 @llvm.smax.i64(i64 %.unpack224.unpack.unpack226, i64 0)
  store ptr %.unpack, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 %59, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %60 = call i1 @_FortranAioOutputDescriptor(ptr %58, ptr nonnull %1)
  %61 = call i32 @_FortranAioEndIoStatement(ptr %58)
  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 i32 @_FortranACharacterCompareScalar1(ptr, ptr, i64, i64) local_unnamed_addr

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

declare i1 @_FortranAioOutputDescriptor(ptr, ptr) local_unnamed_addr

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.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}
