program bm
implicit none
integer::N,C(4)=0
character::S
integer::i
read*,N
do i=1,N
    read*,S
    select case(S)
    case("A")
        C(1)=C(1)+1
    case("W")
        C(2)=C(2)+1
    case("T")
        C(3)=C(3)+1
    case("R")
        C(4)=C(4)+1
    end select
end do
print'("AC x ",i0)',C(1)
print'("WA x ",i0)',C(2)
print'("TLE x ",i0)',C(3)
print'("RE x ",i0)',C(4)
end program bm
; 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.0 = internal unnamed_addr global i32 0
@_QFEc.1 = internal unnamed_addr global i32 0
@_QFEc.2 = internal unnamed_addr global i32 0
@_QFEc.3 = internal unnamed_addr global i32 0
@_QQcl.8ea00b2a2867c9c168e0bc071264b0ef = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_979/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.28224143207820222C693029 = linkonce constant [12 x i8] c"(\22AC x \22,i0)"
@_QQcl.28225741207820222C693029 = linkonce constant [12 x i8] c"(\22WA x \22,i0)"
@_QQcl.2822544C45207820222C693029 = linkonce constant [13 x i8] c"(\22TLE x \22,i0)"
@_QQcl.28225245207820222C693029 = linkonce constant [12 x i8] c"(\22RE x \22,i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca [1 x i8], align 1
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8ea00b2a2867c9c168e0bc071264b0ef, i32 6)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i32, ptr %1, align 4, !tbaa !3
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %24
  %.034 = phi i32 [ %25, %24 ], [ %6, %0 ]
  %8 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8ea00b2a2867c9c168e0bc071264b0ef, i32 8)
  %9 = call i1 @_FortranAioInputAscii(ptr %8, ptr nonnull %2, i64 1)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %8)
  %11 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.41, i64 1, i64 1)
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %.sink.split, label %13

13:                                               ; preds = %.lr.ph
  %14 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.57, i64 1, i64 1)
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %.sink.split, label %16

16:                                               ; preds = %13
  %17 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.54, i64 1, i64 1)
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %.sink.split, label %19

19:                                               ; preds = %16
  %20 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %.sink.split, label %24

.sink.split:                                      ; preds = %19, %16, %13, %.lr.ph
  %_QFEc.0.sink6 = phi ptr [ @_QFEc.0, %.lr.ph ], [ @_QFEc.1, %13 ], [ @_QFEc.2, %16 ], [ @_QFEc.3, %19 ]
  %22 = load i32, ptr %_QFEc.0.sink6, align 4, !tbaa !3
  %23 = add i32 %22, 1
  store i32 %23, ptr %_QFEc.0.sink6, align 4, !tbaa !3
  br label %24

24:                                               ; preds = %.sink.split, %19
  %25 = add nsw i32 %.034, -1
  %26 = icmp sgt i32 %.034, 1
  br i1 %26, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %24, %0
  %27 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28224143207820222C693029, i64 12, ptr null, i32 -1, ptr nonnull @_QQcl.8ea00b2a2867c9c168e0bc071264b0ef, i32 20)
  %28 = load i32, ptr @_QFEc.0, align 4, !tbaa !3
  %29 = call i1 @_FortranAioOutputInteger32(ptr %27, i32 %28)
  %30 = call i32 @_FortranAioEndIoStatement(ptr %27)
  %31 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28225741207820222C693029, i64 12, ptr null, i32 -1, ptr nonnull @_QQcl.8ea00b2a2867c9c168e0bc071264b0ef, i32 21)
  %32 = load i32, ptr @_QFEc.1, align 4, !tbaa !3
  %33 = call i1 @_FortranAioOutputInteger32(ptr %31, i32 %32)
  %34 = call i32 @_FortranAioEndIoStatement(ptr %31)
  %35 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2822544C45207820222C693029, i64 13, ptr null, i32 -1, ptr nonnull @_QQcl.8ea00b2a2867c9c168e0bc071264b0ef, i32 22)
  %36 = load i32, ptr @_QFEc.2, align 4, !tbaa !3
  %37 = call i1 @_FortranAioOutputInteger32(ptr %35, i32 %36)
  %38 = call i32 @_FortranAioEndIoStatement(ptr %35)
  %39 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28225245207820222C693029, i64 12, ptr null, i32 -1, ptr nonnull @_QQcl.8ea00b2a2867c9c168e0bc071264b0ef, i32 23)
  %40 = load i32, ptr @_QFEc.3, align 4, !tbaa !3
  %41 = call i1 @_FortranAioOutputInteger32(ptr %39, i32 %40)
  %42 = call i32 @_FortranAioEndIoStatement(ptr %39)
  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 @_FortranAioInputAscii(ptr, ptr, i64) 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 @_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 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
