integer N
integer,allocatable,dimension(:)::A,C
integer i,j,cnt
read*,N
allocate(A(N),C(N))
read*,A
cnt=0
do i=n,1,-1
  if(A(i)/=0)then
    cnt=cnt+1
    C(cnt)=i
    do j=1,i
      if(j*j>i)exit
      if(mod(i,j)==0)then
        A(j)=xor(A(j),1)
        if(j*j/=i)A(i/j)=xor(A(i/j),1)
      endif
    end do
  endif
end do
print"(I0)",cnt
do i=cnt,1,-1
  if(i==cnt)then
  write(*,'(i0)', advance='no')c(i)
  else
  write(*,'(x,i0)', advance='no')c(i)
  endif
end do
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"

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEa.8 = internal unnamed_addr global i64 0
@_QFEc.0 = internal unnamed_addr global ptr null
@_QQcl.08079d6a253a8a109f82113d399e3185 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3746/source.f\00"
@_QQcl.28493029 = linkonce constant [4 x i8] c"(I0)"
@_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: 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 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.08079d6a253a8a109f82113d399e3185, i32 4)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i32, ptr %2, align 4, !tbaa !3
  %7 = call i32 @llvm.smax.i32(i32 %6, i32 0)
  %8 = zext i32 %7 to i64
  %9 = shl nuw nsw i64 %8, 2
  %10 = call ptr @malloc(i64 %9)
  store ptr %10, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %8, ptr @_QFEa.8, align 8, !tbaa !7
  %11 = call ptr @malloc(i64 %9)
  store ptr %11, ptr @_QFEc.0, align 8, !tbaa !7
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.08079d6a253a8a109f82113d399e3185, i32 6)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack316.unpack.unpack318 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  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 %.unpack316.unpack.unpack318, 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
  %13 = call i1 @_FortranAioInputDescriptor(ptr %12, ptr nonnull %1)
  %14 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %15 = load i32, ptr %2, align 4, !tbaa !3
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph401, label %._crit_edge

.lr.ph401:                                        ; preds = %0
  %.unpack345 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack357 = load ptr, ptr @_QFEc.0, align 8
  %17 = add nuw i32 %15, 1
  %18 = zext i32 %15 to i64
  br label %19

19:                                               ; preds = %.lr.ph401, %.loopexit
  %indvars.iv408 = phi i64 [ %18, %.lr.ph401 ], [ %indvars.iv.next409, %.loopexit ]
  %indvars.iv406 = phi i32 [ %17, %.lr.ph401 ], [ %indvars.iv.next407, %.loopexit ]
  %.0285398 = phi i32 [ 0, %.lr.ph401 ], [ %.1, %.loopexit ]
  %20 = add i64 %indvars.iv408, -1
  %21 = getelementptr i32, ptr %.unpack345, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !3
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %19
  %23 = add i32 %.0285398, 1
  %24 = sext i32 %23 to i64
  %25 = add nsw i64 %24, -1
  %26 = getelementptr i32, ptr %.unpack357, i64 %25
  %27 = trunc i64 %indvars.iv408 to i32
  store i32 %27, ptr %26, align 4, !tbaa !3
  %wide.trip.count = zext i32 %indvars.iv406 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %47
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %47 ]
  %indvars405 = trunc i64 %indvars.iv to i32
  %28 = mul i32 %indvars405, %indvars405
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv408, %29
  br i1 %30, label %.loopexit, label %31

31:                                               ; preds = %.lr.ph
  %32 = srem i32 %27, %indvars405
  %33 = sdiv i32 %27, %indvars405
  %34 = icmp eq i32 %32, 0
  br i1 %34, label %35, label %47

35:                                               ; preds = %31
  %36 = add nsw i64 %indvars.iv, -1
  %37 = getelementptr i32, ptr %.unpack345, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !3
  %39 = xor i32 %38, 1
  store i32 %39, ptr %37, align 4, !tbaa !3
  %40 = zext i32 %28 to i64
  %.not381 = icmp eq i64 %indvars.iv408, %40
  br i1 %.not381, label %47, label %41

41:                                               ; preds = %35
  %42 = sext i32 %33 to i64
  %43 = add nsw i64 %42, -1
  %44 = getelementptr i32, ptr %.unpack345, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !3
  %46 = xor i32 %45, 1
  store i32 %46, ptr %44, align 4, !tbaa !3
  br label %47

47:                                               ; preds = %41, %35, %31
  %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 %.loopexit, label %.lr.ph

.loopexit:                                        ; preds = %47, %.lr.ph, %19
  %.1 = phi i32 [ %.0285398, %19 ], [ %23, %.lr.ph ], [ %23, %47 ]
  %indvars.iv.next409 = add nsw i64 %indvars.iv408, -1
  %indvars411 = trunc i64 %indvars.iv.next409 to i32
  %48 = icmp sgt i32 %indvars411, 0
  %indvars.iv.next407 = add i32 %indvars.iv406, -1
  br i1 %48, label %19, label %._crit_edge

._crit_edge:                                      ; preds = %.loopexit, %0
  %.0285.lcssa = phi i32 [ 0, %0 ], [ %.1, %.loopexit ]
  %49 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28493029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.08079d6a253a8a109f82113d399e3185, i32 21)
  %50 = call i1 @_FortranAioOutputInteger32(ptr %49, i32 %.0285.lcssa)
  %51 = call i32 @_FortranAioEndIoStatement(ptr %49)
  %52 = sext i32 %.0285.lcssa to i64
  %53 = icmp sgt i32 %.0285.lcssa, 0
  br i1 %53, label %.lr.ph403, label %._crit_edge404

.lr.ph403:                                        ; preds = %._crit_edge, %63
  %54 = phi i64 [ %69, %63 ], [ %52, %._crit_edge ]
  %indvars413 = trunc i64 %54 to i32
  %55 = icmp eq i32 %.0285.lcssa, %indvars413
  br i1 %55, label %56, label %59

56:                                               ; preds = %.lr.ph403
  %57 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.08079d6a253a8a109f82113d399e3185, i32 24)
  %58 = call i1 @_FortranAioSetAdvance(ptr %57, ptr nonnull @_QQcl.6E6F, i64 2)
  br label %63

59:                                               ; preds = %.lr.ph403
  %60 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28782C693029, i64 6, ptr null, i32 -1, ptr nonnull @_QQcl.08079d6a253a8a109f82113d399e3185, i32 26)
  %61 = call i1 @_FortranAioSetAdvance(ptr %60, ptr nonnull @_QQcl.6E6F, i64 2)
  %sext = shl i64 %54, 32
  %62 = ashr exact i64 %sext, 32
  br label %63

63:                                               ; preds = %56, %59
  %.sink417 = phi i64 [ %52, %56 ], [ %62, %59 ]
  %.sink414 = phi ptr [ %57, %56 ], [ %60, %59 ]
  %.unpack333.sink = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %64 = add nsw i64 %.sink417, -1
  %65 = getelementptr i32, ptr %.unpack333.sink, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !3
  %67 = call i1 @_FortranAioOutputInteger32(ptr %.sink414, i32 %66)
  %68 = call i32 @_FortranAioEndIoStatement(ptr %.sink414)
  %69 = add nsw i64 %54, -1
  %70 = icmp sgt i64 %54, 1
  br i1 %70, label %.lr.ph403, label %._crit_edge404

._crit_edge404:                                   ; preds = %63, %._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

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

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

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

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