program atcoder_contest_scheduling
  implicit none
  integer :: d, c(26) = 0, s(26, 365) = 0, i, j, x = 0
  read(*,*) d
  read(*,*) c
  read(*,*) (s(:, i), i = 1, d)
  do i = 1, d
    write(*,'(i0)') mod(i - 1, 26) + 1
  end do
end program atcoder_contest_scheduling
; 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"

@_QFEc = internal global [26 x i32] zeroinitializer
@_QFEs = internal global [365 x [26 x i32]] zeroinitializer
@_QQcl.d6febd10c7f916dd80fd6384354a8769 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1017/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca i32, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d6febd10c7f916dd80fd6384354a8769, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d6febd10c7f916dd80fd6384354a8769, i32 5)
  store ptr @_QFEc, ptr %2, align 8, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !3
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !3
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !3
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !3
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  store i64 26, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %8 = call i1 @_FortranAioInputDescriptor(ptr %7, ptr nonnull %2)
  %9 = call i32 @_FortranAioEndIoStatement(ptr %7)
  %10 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d6febd10c7f916dd80fd6384354a8769, i32 6)
  %11 = load i32, ptr %3, align 4, !tbaa !7
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %13 = zext i32 %11 to i64
  %.fca.1.gep4 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  %.fca.2.gep5 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  %.fca.3.gep6 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  %.fca.4.gep7 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  %.fca.5.gep8 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  %.fca.6.gep9 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  %.fca.7.0.0.gep10 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep11 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep12 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  br label %14

14:                                               ; preds = %.lr.ph, %14
  %15 = phi i64 [ 1, %.lr.ph ], [ %20, %14 ]
  %sext = shl i64 %15, 32
  %16 = ashr exact i64 %sext, 32
  %17 = add nsw i64 %16, -1
  %18 = getelementptr [365 x [26 x i32]], ptr @_QFEs, i64 0, i64 %17, i64 0
  store ptr %18, ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep4, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep5, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep6, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep7, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep8, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep9, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep10, align 8, !tbaa !3
  store i64 26, ptr %.fca.7.0.1.gep11, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep12, align 8, !tbaa !3
  %19 = call i1 @_FortranAioInputDescriptor(ptr %10, ptr nonnull %1)
  %20 = add nuw nsw i64 %15, 1
  %exitcond.not = icmp eq i64 %15, %13
  br i1 %exitcond.not, label %._crit_edge, label %14

._crit_edge:                                      ; preds = %14, %0
  %21 = call i32 @_FortranAioEndIoStatement(ptr %10)
  %22 = load i32, ptr %3, align 4, !tbaa !7
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph15.preheader, label %._crit_edge16

.lr.ph15.preheader:                               ; preds = %._crit_edge
  %24 = zext i32 %22 to i64
  br label %.lr.ph15

.lr.ph15:                                         ; preds = %.lr.ph15.preheader, %.lr.ph15
  %25 = phi i64 [ %33, %.lr.ph15 ], [ %24, %.lr.ph15.preheader ]
  %26 = phi i32 [ %32, %.lr.ph15 ], [ 1, %.lr.ph15.preheader ]
  %27 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.d6febd10c7f916dd80fd6384354a8769, i32 8)
  %28 = add nsw i32 %26, -1
  %.urem = urem i32 %28, 26
  %29 = add nuw nsw i32 %.urem, 1
  %30 = call i1 @_FortranAioOutputInteger32(ptr %27, i32 %29)
  %31 = call i32 @_FortranAioEndIoStatement(ptr %27)
  %32 = add nuw i32 %26, 1
  %33 = add nsw i64 %25, -1
  %34 = icmp ugt i64 %25, 1
  br i1 %34, label %.lr.ph15, label %._crit_edge16

._crit_edge16:                                    ; preds = %.lr.ph15, %._crit_edge
  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 i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

!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 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
