program answer
  implicit none

  integer :: N, i, a, b, c, d
  character :: S(100000)

  read(*,*) N
  do i = 1, n
     read(*,*) S(i:i)
  end do

  a=0
  b=0
  c=0
  d=0

  do i = 1, n
     if(S(i)=='A') then
        a=a+1
     else if(S(i)=="W") then
        b=b+1
     else if(S(i)=="T") then
        c=c+1
     else if(S(i)=="R") then
        d=d+1
     end if
  end do

  write(*,*) 'AC', ' x',a
  write(*,*) 'WA', ' x', b
  write(*,*) 'TLE', ' x', c
  write(*,*) 'RE', ' x', d

  stop
 end program answer

; 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 [100000 x [1 x i8]] undef
@_QQcl.6721c69f277ca41f5504361ec4363fa5 = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_988/source.f\00"
@_QQcl.41 = linkonce constant [1 x i8] c"A"
@_QQcl.57 = linkonce constant [1 x i8] c"W"
@_QQcl.54 = linkonce constant [1 x i8] c"T"
@_QQcl.52 = linkonce constant [1 x i8] c"R"
@_QQcl.4143 = linkonce constant [2 x i8] c"AC"
@_QQcl.2078 = linkonce constant [2 x i8] c" x"
@_QQcl.5741 = linkonce constant [2 x i8] c"WA"
@_QQcl.544C45 = linkonce constant [3 x i8] c"TLE"
@_QQcl.5245 = linkonce constant [2 x i8] c"RE"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %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.6721c69f277ca41f5504361ec4363fa5, i32 7)
  %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 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge29

.lr.ph:                                           ; preds = %0
  %8 = zext i32 %6 to i64
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  %.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
  %.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
  %.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
  br label %9

9:                                                ; preds = %.lr.ph, %9
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %9 ]
  %10 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6721c69f277ca41f5504361ec4363fa5, i32 9)
  %11 = add nsw i64 %indvars.iv, -1
  %12 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %11
  store ptr %12, ptr %1, align 8, !tbaa !7
  store i64 1, ptr %.fca.1.gep, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  store i64 1, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  store i64 1, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %13 = call i1 @_FortranAioInputDescriptor(ptr %10, ptr nonnull %1)
  %14 = call i32 @_FortranAioEndIoStatement(ptr %10)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %8
  br i1 %exitcond.not, label %._crit_edge, label %9

._crit_edge:                                      ; preds = %9
  %.pre = load i32, ptr %2, align 4, !tbaa !3
  %15 = icmp sgt i32 %.pre, 0
  br i1 %15, label %.lr.ph28.preheader, label %._crit_edge29

.lr.ph28.preheader:                               ; preds = %._crit_edge
  %16 = zext i32 %.pre to i64
  br label %.lr.ph28

.lr.ph28:                                         ; preds = %.lr.ph28.preheader, %37
  %indvars.iv34 = phi i64 [ 1, %.lr.ph28.preheader ], [ %indvars.iv.next35, %37 ]
  %.026 = phi i32 [ 0, %.lr.ph28.preheader ], [ %.1, %37 ]
  %.01525 = phi i32 [ 0, %.lr.ph28.preheader ], [ %.116, %37 ]
  %.01724 = phi i32 [ 0, %.lr.ph28.preheader ], [ %.118, %37 ]
  %.01923 = phi i32 [ 0, %.lr.ph28.preheader ], [ %.120, %37 ]
  %17 = add nsw i64 %indvars.iv34, -1
  %18 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %17
  %19 = call i32 @_FortranACharacterCompareScalar1(ptr %18, ptr nonnull @_QQcl.41, i64 1, i64 1)
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %23

21:                                               ; preds = %.lr.ph28
  %22 = add i32 %.01923, 1
  br label %37

23:                                               ; preds = %.lr.ph28
  %24 = call i32 @_FortranACharacterCompareScalar1(ptr %18, ptr nonnull @_QQcl.57, i64 1, i64 1)
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  %27 = add i32 %.01724, 1
  br label %37

28:                                               ; preds = %23
  %29 = call i32 @_FortranACharacterCompareScalar1(ptr %18, ptr nonnull @_QQcl.54, i64 1, i64 1)
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %33

31:                                               ; preds = %28
  %32 = add i32 %.01525, 1
  br label %37

33:                                               ; preds = %28
  %34 = call i32 @_FortranACharacterCompareScalar1(ptr %18, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %35 = icmp eq i32 %34, 0
  %36 = zext i1 %35 to i32
  %spec.select = add i32 %.026, %36
  br label %37

37:                                               ; preds = %33, %21, %26, %31
  %.120 = phi i32 [ %22, %21 ], [ %.01923, %26 ], [ %.01923, %31 ], [ %.01923, %33 ]
  %.118 = phi i32 [ %.01724, %21 ], [ %27, %26 ], [ %.01724, %31 ], [ %.01724, %33 ]
  %.116 = phi i32 [ %.01525, %21 ], [ %.01525, %26 ], [ %32, %31 ], [ %.01525, %33 ]
  %.1 = phi i32 [ %.026, %21 ], [ %.026, %26 ], [ %.026, %31 ], [ %spec.select, %33 ]
  %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
  %exitcond37.not = icmp eq i64 %indvars.iv34, %16
  br i1 %exitcond37.not, label %._crit_edge29, label %.lr.ph28

._crit_edge29:                                    ; preds = %37, %0, %._crit_edge
  %.019.lcssa = phi i32 [ 0, %._crit_edge ], [ 0, %0 ], [ %.120, %37 ]
  %.017.lcssa = phi i32 [ 0, %._crit_edge ], [ 0, %0 ], [ %.118, %37 ]
  %.015.lcssa = phi i32 [ 0, %._crit_edge ], [ 0, %0 ], [ %.116, %37 ]
  %.0.lcssa = phi i32 [ 0, %._crit_edge ], [ 0, %0 ], [ %.1, %37 ]
  %38 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.6721c69f277ca41f5504361ec4363fa5, i32 29)
  %39 = call i1 @_FortranAioOutputAscii(ptr %38, ptr nonnull @_QQcl.4143, i64 2)
  %40 = call i1 @_FortranAioOutputAscii(ptr %38, ptr nonnull @_QQcl.2078, i64 2)
  %41 = call i1 @_FortranAioOutputInteger32(ptr %38, i32 %.019.lcssa)
  %42 = call i32 @_FortranAioEndIoStatement(ptr %38)
  %43 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.6721c69f277ca41f5504361ec4363fa5, i32 30)
  %44 = call i1 @_FortranAioOutputAscii(ptr %43, ptr nonnull @_QQcl.5741, i64 2)
  %45 = call i1 @_FortranAioOutputAscii(ptr %43, ptr nonnull @_QQcl.2078, i64 2)
  %46 = call i1 @_FortranAioOutputInteger32(ptr %43, i32 %.017.lcssa)
  %47 = call i32 @_FortranAioEndIoStatement(ptr %43)
  %48 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.6721c69f277ca41f5504361ec4363fa5, i32 31)
  %49 = call i1 @_FortranAioOutputAscii(ptr %48, ptr nonnull @_QQcl.544C45, i64 3)
  %50 = call i1 @_FortranAioOutputAscii(ptr %48, ptr nonnull @_QQcl.2078, i64 2)
  %51 = call i1 @_FortranAioOutputInteger32(ptr %48, i32 %.015.lcssa)
  %52 = call i32 @_FortranAioEndIoStatement(ptr %48)
  %53 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.6721c69f277ca41f5504361ec4363fa5, i32 32)
  %54 = call i1 @_FortranAioOutputAscii(ptr %53, ptr nonnull @_QQcl.5245, i64 2)
  %55 = call i1 @_FortranAioOutputAscii(ptr %53, ptr nonnull @_QQcl.2078, i64 2)
  %56 = call i1 @_FortranAioOutputInteger32(ptr %53, i32 %.0.lcssa)
  %57 = call i32 @_FortranAioEndIoStatement(ptr %53)
  %58 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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 i32 @_FortranACharacterCompareScalar1(ptr, ptr, i64, i64) local_unnamed_addr

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

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

attributes #0 = { noreturn }

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