Problem:
 Score : 200 points    Problem Statement Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i ( 1\leq i \leq N ), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC , WA , TLE , and RE , respectively.  See the Output section for the output format.      Constraints  1 \leq N \leq 10^5  S_i is AC , WA , TLE , or RE .         Input Input is given from Standard Input in the following format:  N  S_1  \vdots  S_N       Output Let C_0 , C_1 , C_2 , and C_3 be the numbers of test cases for which the verdict is AC , WA , TLE , and RE , respectively. Print the following:  AC x C_0 WA x C_1 TLE x C_2 RE x C_3         Sample Input 1 6
AC
TLE
AC
AC
WA
TLE      Sample Output 1 AC x 3
WA x 1
TLE x 2
RE x 0  We have 3 , 1 , 2 , and 0 test case(s) for which the verdict is AC , WA , TLE , and RE , respectively.       Sample Input 2 10
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC      Sample Output 2 AC x 10
WA x 0
TLE x 0
RE x 0

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy



from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush, heapify
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7

def main():
    n = int(input())
    dic = defaultdict(int)
    for _ in range(n):
        dic[input()] += 1
    print('AC x',dic['AC'])
    print('WA x',dic['WA'])
    print('TLE x',dic['TLE'])
    print('RE x',dic['RE'])
if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
a = [input() for i in range(N)]
 
countac = 0
countwa = 0
counttle = 0
countre = 0
for A in a:
  if A == "AC":
    countac += 1
  elif A == "WA":
    countwa += 1
  elif A == "TLE":
    counttle += 1
  elif A == "RE":
    countre += 1

print("AC x %d" % countac)
print("WA x %d" % countwa)
print("TLE x %d" % counttle)
print("RE x %d" % countre)

Solution (Python):
N = int(input())
S = []
for i in range(N):
    S.append(input())

c0, c1, c2, c3 = [0, 0, 0, 0]

for s in S:
    if s == 'AC':
        c0 += 1
    elif s == 'WA':
        c1 += 1
    elif s == 'TLE':
        c2 += 1
    elif s == 'RE':
        c3 += 1

print("AC x", c0)
print("WA x", c1)
print("TLE x", c2)
print("RE x", c3)

Solution (Python):
N=int(input())
ac=0
wa=0
tle=0
re=0
for i in range(N):
    s=input()
    if s=="AC":
        ac+=1
    elif s=="WA":
        wa+=1
    elif s=="TLE":
        tle+=1
    else:
        re+=1
print("AC x",ac)
print("WA x",wa)
print("TLE x",tle)
print("RE x",re)

Solution (Python):
n = int(input())
s = [input() for i in range(n)]
ac = s.count("AC")
wa = s.count("WA")
tle = s.count("TLE")
re = s.count("RE")

print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))

Solution (Python):


n = int(input())

l = []
for i in range(n):
    l.append(input())

print("AC x {}".format(l.count("AC")))
print("WA x {}".format(l.count("WA")))
print("TLE x {}".format(l.count("TLE")))
print("RE x {}".format(l.count("RE")))

Solution (Python):
N=int(input())
test_case=[input() for _ in range(N)]
a=test_case.count('AC')
b=test_case.count('WA')
c=test_case.count('TLE')
d=test_case.count('RE')
print('AC x '+ str(a))
print('WA x '+ str(b))
print('TLE x '+str(c))
print('RE x '+str(d))

Solution (Python):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    i = input()
    if i == 'AC':
        ac += 1
    elif i == 'WA':
        wa += 1
    elif i == 'TLE':
        tle += 1
    elif i == 'RE':
        re += 1

print('AC x ' + str(ac))
print('WA x ' + str(wa))
print('TLE x ' + str(tle))
print('RE x ' + str(re))

Solution (Python):
n = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(n):
  s = input()
  if s=="AC":
    AC+=1
  elif s=="WA":
    WA+=1
  elif s=="TLE":
    TLE+=1
  else:
    RE+=1

print(f"AC x {AC}")
print(f"WA x {WA}")
print(f"TLE x {TLE}")
print(f"RE x {RE}")

Solution (Python):
from collections import defaultdict
n=int(input())
dic=defaultdict(int)
for i in range(n):
    x=input()
    if x in dic:
        dic[x]+=1
    else:
        dic[x]=1
print("AC x",dic["AC"])
print("WA x",dic["WA"])
print("TLE x",dic["TLE"])
print("RE x",dic["RE"])

Solution (Python):
N = int(input())
S = []
for i in range(N):
    S.append(input())
print('AC x ' + str(S.count('AC')))
print('WA x ' + str(S.count('WA')))
print('TLE x ' + str(S.count('TLE')))
print('RE x ' + str(S.count('RE')))

Solution (Python):
n = int(input())
slist = [input() for i in range(n)]

ans = [0 for i in range(4)]

for i in slist:
  if (i == 'AC'):
    ans[0] = ans[0] + 1
  if (i == 'WA'):
    ans[1] = ans[1] + 1
  if (i == 'TLE'):
    ans[2] = ans[2] + 1
  if (i == 'RE'):
    ans[3] = ans[3] + 1


for i in range(4):
  if(i == 0):
    print("AC x " + str(ans[i]))
  if(i == 1):
    print("WA x " + str(ans[i]))
  if(i == 2):
    print("TLE x " + str(ans[i]))
  if(i == 3):
    print("RE x " + str(ans[i]))

Solution (Python):
def main():
    N = int(input())
    d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
    for i in range(N):
        S = str(input())
        d[S] += 1
    AC = d['AC']
    AC = str(AC)
    WA = d['WA']
    WA = str(WA)
    TLE = d['TLE']
    TLE = str(TLE)
    RE = d['RE']
    RE = str(RE)
    print('AC x ' + AC)
    print('WA x ' + WA)
    print('TLE x ' + TLE)
    print('RE x ' + RE)
main()

Solution (Python):
N=int(input())
S=[""]*N
for i in range(N):
  S[i]=input()
print("AC x", S.count("AC"))
print("WA x", S.count("WA"))
print("TLE x", S.count("TLE"))
print("RE x",S.count("RE"))

Solution (Python):
N = int(input())
x = [input() for i in range(N)]
AC = 0
WA = 0
TLE = 0
RE = 0
for t in range(N):
    if x[t] == 'AC':
        AC += 1
    elif x[t] == 'WA':
        WA += 1
    elif x[t] == 'TLE':
        TLE += 1
    else:
        RE += 1
print('AC x',AC)
print('WA x',WA)
print('TLE x',TLE)
print('RE x',RE)

Solution (Python):
n = int(input())
s = { "AC" : 0, "WA" : 0, "TLE" : 0, "RE" : 0 }
for i in range(n):
    s_in = input()
    s[s_in] += 1
print("AC x " + str(s["AC"]))
print("WA x " + str(s["WA"]))
print("TLE x " + str(s["TLE"]))
print("RE x " + str(s["RE"]))

Solution (Python):
N = int(input())

s_list = {"AC": 0, "TLE": 0, "WA": 0, "RE": 0}



for i in range(N):
  s = input()
  if s == "AC":
    s_list["AC"] += 1
  elif s == "TLE":
    s_list["TLE"] += 1
  elif s == "WA":
    s_list["WA"] += 1
  else:
    s_list["RE"] += 1
    

print("AC x {}\nWA x {}\nTLE x {}\nRE x {}".format(s_list["AC"], s_list["WA"], s_list["TLE"], s_list["RE"]))

Solution (Python):
N = int(input())
a = [input() for i in range(N)]

print("AC x",a.count('AC'))

print("WA x",a.count('WA'))

print("TLE x",a.count('TLE'))

print("RE x",a.count('RE'))

Solution (Python):
def main():
    N = int(input())
    judges = [input() for _ in range(N)]
    
    res_dic = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
    for judge in judges:
        if judge in res_dic:
            res_dic[judge] += 1
        else:
            res_dic[judge] = 0
            
    for k, v in res_dic.items():
        print("{} x {}".format(k, v))

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
ac, re, wa, tle = 0,0,0,0
for i in range(N):
  line = input()
  if line == "AC":
    ac += 1
  elif line == "TLE":
    tle += 1
  elif line == "WA":
    wa += 1
  elif line == "RE":
    re += 1
print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))

Solution (Python):




N = int( input())
S_LIST = []
C0 = 0
C1 = 0
C2 = 0
C3 = 0

for i in range(N):
        s = input()
        if s == 'AC':
                C0 += 1
        elif s == 'WA':
                C1 += 1
        elif s == 'TLE':
                C2 += 1
        elif s == 'RE':
                C3 += 1

print("AC x",C0)
print("WA x",C1)
print("TLE x",C2)
print("RE x",C3)

Solution (Python):
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for i in range(N):
    S = str(input())
    if S == 'AC':
        ac += 1
    elif S == 'WA':
        wa += 1
    elif S == 'TLE':
        tle += 1
    elif S == 'RE':
        re += 1
print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))

Solution (Python):
n = int(input())
judge = [input() for _ in range(n)]
ans = [0]*4
for i in judge:
    if i == "AC":
        ans[0] += 1
    elif i == "WA":
        ans[1] += 1
    elif i == "TLE":
        ans[2] += 1
    else:
        ans[3] += 1

print("AC x {}".format(ans[0]))
print("WA x {}".format(ans[1]))
print("TLE x {}".format(ans[2]))
print("RE x {}".format(ans[3]))

Solution (Python):
n=int(input())
x=[input() for i in range(n)]
print('AC x',x.count('AC'))
print('WA x',x.count('WA'))
print('TLE x',x.count('TLE'))
print('RE x',x.count('RE'))

Solution (Python):
N = int(input())
S = []
for n in range(N):
    S.append(input())

print('AC x',S.count('AC'))
print('WA x',S.count('WA'))
print('TLE x',S.count('TLE'))
print('RE x',S.count('RE'))

Solution (Python):
N = int(input())
x = ""
S = []
for i in range(N):
    x = input()
    S.append(x)
ans = [0]*4
for i in range(N):
    if S[i] == "AC":
        ans[0] += 1
    elif S[i] == "WA":
        ans[1] += 1
    elif S[i] == "TLE":
        ans[2] += 1
    elif S[i] == "RE":
        ans[3] += 1
print('AC x ',end='')
print(ans[0])
print('WA x ',end='')
print(ans[1])
print('TLE x ',end='')
print(ans[2])
print('RE x ',end='')
print(ans[3])

Solution (Python):
n = int(input())
s = list(input() for _ in range(n))
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
    if s[i] == "AC":
        ac += 1
    elif s[i] == "WA":
        wa += 1
    elif s[i] == "TLE":
        tle += 1
    else:
        re += 1
print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))

Solution (Python):
n = int(input())

s = [input() for _ in range(n)]

print('AC x' , s.count('AC'))
print('WA x ' , s.count('WA'))
print('TLE x ' , s.count('TLE'))
print('RE x ' , s.count('RE'))

Solution (Python):
N = int(input())
list = [''] * N
judge = [0] *4




for i in range(0, N):
    list[i] = input()
    if list[i] == 'AC':
        judge[0] += 1
    elif list[i] == 'WA':
        judge[1] += 1
    elif list[i] == 'TLE':
        judge[2] += 1
    else:
        judge[3] += 1

print('AC x ' + str(judge[0]))
print('WA x ' + str(judge[1]))
print('TLE x ' + str(judge[2]))
print('RE x ' + str(judge[3]))

Solution (Python):
import sys

m = {'AC' : 0, 'WA' : 0, 'TLE' : 0, 'RE' : 0}

data = sys.stdin.readlines()
data.pop(0)
for line in data:
    v = line.rstrip()
    if not "" == v:
        m[v] += 1

for k, v in m.items():
    print(k,' x ', v)

Solution (Python):
N = int(input())

import collections

S_list = [input() for i in range(N)]

S_count = collections.Counter(S_list)

if 'AC' in S_count:
    print('AC x {}'.format(S_count['AC']))
else:
    print('AC x 0')

if 'WA' in S_count:
    print('WA x {}'.format(S_count['WA']))
else:
    print('WA x 0')
if 'TLE' in S_count:
    print('TLE x {}'.format(S_count['TLE']))
else:
    print('TLE x 0')
if 'RE' in S_count:
    print('RE x {}'.format(S_count['RE']))
else:
    print('RE x 0')

Solution (Python):
l=[0,0,0,0]
n=int(input())
for _ in range(n):
  s=str(input())
  if s=='AC': l[0]+=1
  if s=='WA': l[1]+=1
  if s=='TLE': l[2]+=1
  if s=='RE': l[3]+=1
print('AC '+'x '+str(l[0]))
print('WA '+'x '+str(l[1]))
print('TLE '+'x '+str(l[2]))
print('RE '+'x '+str(l[3]))

Solution (Python):
n = int(input())
list1 = []
for i in range(n):
    get = input()
    list1.append(get)
print("AC x {}".format (list1.count("AC")))
print("WA x {}".format (list1.count("WA")))
print("TLE x {}".format (list1.count("TLE")))
print("RE x {}".format (list1.count("RE")))

Solution (Python):
N=int(input())
s=[]
for i in range(N):
    s.append(input())
a=s.count('AC')
b=s.count('WA')
c=s.count('TLE')
d=s.count('RE')
print('AC x ' +str(a))
print('WA x ' +str(b))
print('TLE x ' +str(c))
print('RE x ' +str(d))

Solution (Python):
n=int(input())

countAC=0
countWA=0
countTLE=0
countRE=0

for i in range(n):
    s=input()
    if s=="AC":
        countAC += 1
    elif s=="WA":
        countWA += 1
    elif s=="TLE":
        countTLE += 1
    else:
        countRE += 1

print("AC x " + str(countAC))
print("WA x " + str(countWA))
print("TLE x " + str(countTLE))
print("RE x " + str(countRE))

Solution (Python):
n = int(input())
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for i in range(n):
  s = input()
  d[s] += 1
for i, j in d.items():
  print(i, 'x', j)

Solution (Python):
N = int(input())
l = [input() for _ in range(N)]
ch = {'AC': 0, 'WA':0, 'TLE':0, 'RE':0}

for key, value in ch.items():
  ch[key] = l.count(key)

for key, value in ch.items():
  print(key + ' x ' + str(value))

Solution (Python):
N = int(input())
c = [input() for i in range(N)]
num_AC = c.count('AC')
print('AC x {}'.format(num_AC))
num_WA = c.count('WA')
print('WA x {}'.format(num_WA))
num_TLE = c.count('TLE')
print('TLE x {}'.format(num_TLE))
num_RE = c.count('RE')
print('RE x {}'.format(num_RE))

Solution (Python):
N = int(input())
S = list(str(input()) for _ in range(N))

AC = 0
WA = 0
TLE = 0
RE = 0
for s in S:
    if s =='AC':
        AC +=1
    elif s == 'WA':
        WA +=1
    elif s == 'TLE':
        TLE += 1
    elif s == 'RE':
        RE  +=1

print('AC x {}'.format(str(AC)))
print('WA x {}'.format(str(WA)))
print('TLE x {}'.format(str(TLE)))
print('RE x {}'.format(str(RE)))

Solution (Python):
number = int(input())
list1 = [0, 0, 0, 0]
list2 = ['AC', 'WA', 'TLE', 'RE']

for _ in range(number):
  word = input()
  if word == 'AC':
    list1[0] = list1[0] + 1
  elif word == 'WA':
    list1[1] = list1[1] + 1
  elif word == 'TLE':
    list1[2] = list1[2] + 1
  elif word == 'RE':
    list1[3] = list1[3] + 1
    
for i in range(len(list1)):
  print(list2[i], 'x',  list1[i])

Solution (Python):
n = int(input())
C = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for i in range(n):
    C[input()] += 1
for s in C:
    print(f'{s} x {C[s]}')

Solution (Python):
AC = 0
WA = 0
TLE = 0
RE = 0

N = int(input())
for _ in range(N):
    TMP = input()
    
    if TMP == "AC":
        AC += 1
    elif TMP == "WA":
        WA += 1
    elif TMP == "TLE":
        TLE += 1
    elif TMP == "RE":
        RE += 1

print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))

Solution (Python):






n = int(input())
s = [input()for _ in range(n)]
ac = 0
wa = 0
tle = 0
re = 0

for i in s:
    if i == "AC":
        ac += 1
    elif i == "WA":
        wa += 1
    elif i == "TLE":
        tle += 1
    else:
        re += 1

print("AC" + " x ", end = "")
print( ac)
print("WA" + " x ", end = "")
print( wa)
print("TLE" + " x ", end = "")
print( tle)
print("RE" + " x ", end = "")
print( re)

Solution (Python):
n = int(input())

c = [0,0,0,0]

for i in range(n):
    s = input()
    if s == "AC":
        c[0] += 1
    elif s == "WA":
        c[1] += 1
    elif s == "TLE":
        c[2] += 1
    else:
        c[3] += 1

print("AC x " , c[0])
print("WA x " , c[1])
print("TLE x " , c[2])
print("RE x " , c[3])

Solution (Python):
from sys import stdin
input = stdin.readline

N = int(input())
list_result = [input() for i in range(N)]

AC_cnt = 0
WA_cnt = 0
TLE_cnt = 0
RE_cnt = 0


for i in list_result:
    if i == "AC\n":
        AC_cnt += 1

    elif i == "WA\n":
        WA_cnt += 1
    elif i == "TLE\n":
        TLE_cnt += 1

    elif i == "RE\n":
        RE_cnt += 1

print("AC x",AC_cnt ,"\n" "WA x",WA_cnt,"\n" "TLE x",TLE_cnt,"\n" "RE x",RE_cnt )

Solution (Python):
N = int(input()) 
s = [input() for i in range(N)] 
ac = s.count("AC")
wa = s.count("WA")
tle = s.count("TLE")
re = s.count("RE")
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

Solution (Python):
N = int(input())
S = [input() for i in range(N)]
print("AC x "+str( S.count("AC")))
print("WA x "+str( S.count("WA")))
print("TLE x "+str( S.count("TLE")))
print("RE x "+str( S.count("RE")))

Solution (Python):
n=int(input())
s=[0]*n
for i in range(n):
  s[i]=input()
  
print("AC x "+str(s.count('AC')))
print("WA x "+str(s.count('WA')))
print("TLE x "+str(s.count('TLE')))
print("RE x "+str(s.count('RE')))

Solution (Python):
n=int(input())
dic={'AC':0,'WA':0,'TLE':0,'TLE':0,'RE':0}
for i in range(n):
  dic[input()]+=1
for i in dic:
  print(i,'x',dic[i])

Solution (Python):
N, *S = open(0).read().split()
d = {
    'AC': 0,
    'WA': 0,
    'TLE': 0,
    'RE': 0,
}
for s in S:
    if s in d:
        d[s] += 1
print('AC x', d['AC'])
print('WA x', d['WA'])
print('TLE x', d['TLE'])
print('RE x', d['RE'])

Solution (Python):
import math

q = int(input().strip())
count = {}
count['AC'] = 0
count['WA'] = 0
count['TLE'] = 0
count['RE'] = 0
for i in range(q):
    b = input().strip()
    count[b] += 1

print('AC x {}'.format(count['AC']))
print('WA x {}'.format(count['WA']))
print('TLE x {}'.format(count['TLE']))
print('RE x {}'.format(count['RE']))

Solution (Python):
n = int(input())
from collections import Counter
ss = []
for i in range(n):
    ss.append(input())
c = Counter(ss)
for w in ["AC", "WA", "TLE", "RE"]:
    if w in c.keys():
        print(f"{w} x {c[w]}")
    else:
        print(f"{w} x 0")

Solution (Python):
n = int(input())
s = [0] * n
for i in range(n):
    s[i] = input()
print('AC x ' + str(s.count('AC')))
print('WA x ' + str(s.count('WA')))
print('TLE x ' + str(s.count('TLE')))
print('RE x ' + str(s.count('RE')))

Solution (Python):
N = int(input())
c_AC = 0
c_WA = 0
c_TLE = 0
c_RE = 0
for _ in range(N):
    X = input()
    if X == "AC":
        c_AC += 1
    if X == "WA":
        c_WA += 1
    if X == "TLE":
        c_TLE += 1 
    if X == "RE":
        c_RE += 1
       

print("AC "+"x "+str(c_AC))
print("WA "+"x "+str(c_WA))
print("TLE "+"x "+str(c_TLE))
print("RE "+"x "+str(c_RE))

Solution (Python):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for _ in range(n):
  x = input()
  if x == 'AC':
    ac += 1
  elif x == 'WA':
    wa += 1
  elif x == 'TLE':
    tle += 1
  else:
    re += 1
    
print('AC x ', ac)
print('WA x ', wa)
print('TLE x ', tle)
print('RE x ', re)

Solution (Python):
result = []
for _ in range(int(input())):
  result.append(input())
print("AC x {}".format(result.count("AC")))
print("WA x {}".format(result.count("WA")))
print("TLE x {}".format(result.count("TLE")))
print("RE x {}".format(result.count("RE")))

Solution (Python):
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'
    
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in range(base**n):s=[tb//(base**bt)%base for bt in range(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase

read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
input=lambda: sys.stdin.readline().rstrip()

class Tree:
    def __init__(self,inp_size=None,ls=None,init=True,index=1):
        self.LCA_init_stat=False
        self.ETtable=[]
        if init:
            if ls==None:
                self.stdin(inp_size,index=index)
            else:
                self.node_size=len(ls)+1
                self.edges,_=GI(self.node_size,self.node_size-1,ls,index=index)
        return
 
    def stdin(self,inp_size=None,index=1):
        if inp_size==None:
            self.node_size=int(input())
        else:
            self.node_size=inp_size
        self.edges,_=GI(self.node_size,self.node_size-1,index=index)
        return
    
    def listin(self,ls,index=0):
        self.node_size=len(ls)+1
        self.edges,_=GI(self.node_size,self.node_size-1,ls,index=index)
        return
 
    def dfs(self,x,func=lambda pr,prv,nx,dist:prv+dist,root_v=0):
        q=deque([x])
        v=[None]*self.node_size
        v[x]=root_v
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=func(c,v[c],nb,d)
        return v
 
    def bfs(self,x,func=lambda pr,prv,nx,dist:prv+dist,root_v=0):
        q=deque([x])
        v=[None]*self.node_size
        v[x]=root_v
        while q:
            c=q.popleft()
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=func(c,v[c],nb,d)
        return v
 
    def parent(self,x):
        return self.dfs(0,func=lambda pr,prv,nx,dist:pr,root_v=-1)
 
    def topological_sort(self,x):  
        tps=[]
        q=deque([x])
        v=[None]*self.node_size
        v[x]=0
        while q:
            c=q.popleft()
            tps.append(c)
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=0
        return tps
 
    def EulerTour(self,x):
        q=deque()
        q.append(x)
        self.depth=[None]*self.node_size
        self.depth[x]=0
        self.ETtable=[]
        self.ETdepth=[]
        self.ETin=[-1]*self.node_size
        self.ETout=[-1]*self.node_size
        cnt=0
        while q:
            c=q.pop()
            if c<0:
                ce=~c
            else:
                ce=c
                for nb,d in self.edges[ce]:
                    if self.depth[nb]==None:
                        q.append(~ce)
                        q.append(nb)
                        self.depth[nb]=self.depth[ce]+1
            self.ETtable.append(ce)
            self.ETdepth.append(self.depth[ce])
            if self.ETin[ce]==-1:
                self.ETin[ce]=cnt
            else:
                self.ETout[ce]=cnt
            cnt+=1
        return
    
    def doubling_LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            self.depth=[None]*self.node_size
            self.depth=self.bfs(0,func=lambda pr,prv,nxt,dist:prv+1)
            self.par=self.bfs(0,func=lambda pr,prv,nxt,dist:pr)
            self.db=[self.par]
            for i in range(self.node_size.bit_length()):
                
                self.db+=[[self.db[-1][self.db[-1][i]] for i in range(self.node_size)]]
            self.LCA_init_stat=True
        dx=self.depth[x]
        dy=self.depth[y]
        if dx>dy:
            dx,dy=dy,dx
        c=self.node_size.bit_length()
        while c>0:
            if dx+c<=dy:
                x=self.db[c][x]
                dx+=1<<c
            c>>=1
        
        if x==y:
            return x
        
        c=self.node_size.bit_length()
        while c>0:
            if self.db[c][x]!=self.db[c][y]:
                x=self.db[c][x]
                y=self.db[c][y]
            c>>=1
        
        return self.par[x]
        
    def LCA_init(self,root):
        self.EulerTour(root)
        self.st=SparseTable(self.ETdepth,init_func=min,init_idl=inf)
        
        self.LCA_init_stat=True
        return
    
    def LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            self.LCA_init(root)
        xin,xout=self.ETin[x],self.ETout[x]
        yin,yout=self.ETin[y],self.ETout[y]
        a=min(xin,yin)
        b=max(xout,yout,xin,yin)
        id_of_min_dep_in_et=self.st.query_id(a,b+1)
        return self.ETtable[id_of_min_dep_in_et]
 
    def __str__(self):
        return  str(self.edges)
 
    def show(self):
        if all([all([d==1 for nd,d in e]) for e in self.edges]):
            print( [[nd for nd,d in e] for e in self.edges] )
        else:
            print(self)
 
    def dfs2(self,x,func=lambda pr,prv,nx,dist:prv+dist,root_v=0):
        q=deque([x])
        v=[None]*self.node_size
        v[x]=root_v
        dfs_tr=[x]
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=func(c,v[c],nb,d)
                    dfs_tr+=nb,
        return v,dfs_tr

class SparseTable: 
    def __init__(self,ls,init_func=min,init_idl=float('inf')):
        self.func=init_func
        self.idl=init_idl
        self.size=len(ls)
        self.N0=self.size.bit_length()
        self.table=[ls[:]]
        self.index=[list(range(self.size))]
        self.lg=[0]*(self.size+1)
        
        for i in range(2,self.size+1):
            self.lg[i]=self.lg[i>>1]+1
 
        for i in range(self.N0):
            tmp=[self.func(self.table[i][j],self.table[i][min(j+(1<<i),self.size-1)]) for j in range(self.size)]
            tmp_id=[self.index[i][j] if self.table[i][j]==self.func(self.table[i][j],self.table[i][min(j+(1<<i),self.size-1)]) else self.index[i][min(j+(1<<i),self.size-1)] for j in range(self.size)]
            self.table+=[tmp]
            self.index+=[tmp_id]
    
    
    def query(self,l,r):
        if r>self.size:r=self.size
        
        N=self.lg[r-l]
        return self.func(self.table[N][l],self.table[N][max(0,r-(1<<N))])
    
    
    def query_id(self,l,r):
        if r>self.size:r=self.size
        
        N=self.lg[r-l]
        a,b=self.index[N][l],self.index[N][max(0,r-(1<<N))]
        if self.table[0][a]==self.func(self.table[N][l],self.table[N][max(0,r-(1<<N))]):
            b=a
        return b
    
    
    def right_bound(self,pos,x):
        k=(self.size-pos).bit_length()
        for j in range(k)[::-1]:
            nx=pos+(1<<j)
            if nx<n and self.query(pos,nx+1)<=x:
                pos+=(1<<j)
        return pos
    
    
    def left_bound(self,pos,x):
        k=pos.bit_length()
        for j in range(k)[::-1]:
            nx=pos-(1<<j)
            if 0<=nx and self.query(nx,pos+1)<=x:
                pos-=(1<<j)
        return pos

    def __str__(self):
        return str(self.table[0])
 
    def print(self):
        for i in self.table:
            print(*i)

show_flg=False
show_flg=True

ans=0


n=I()
ca=['AC','WA','TLE','RE']
d=defaultdict(int)
for i in ca:
    d[i]=0
    
for i in range(n):
    s=input()
    d[s]+=1

for i in ca:
    print(i,'x',d[i])

Solution (Python):
n = int(input())
s = []
for i in range(n):
    a = input()
    s.append(a)
print("AC x",s.count('AC'))
print("WA x",s.count('WA'))
print("TLE x",s.count('TLE'))
print("RE x",s.count('RE'))

Solution (Python):
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
a = Counter(s)
AC = 0
WA = 0
TLE = 0
RE = 0

if "AC" not in a.keys():
    AC = 0
else:
    AC = a['AC']
if "WA" not in a.keys():
    WA = 0
else:
    WA = a['WA']
if "TLE" not in a.keys():
    TLE = 0
else:
    TLE = a['TLE']
if "RE" not in a.keys():
    RE = 0
else:
    RE = a['RE']

    
print("AC x {}".format(AC))
print("WA x {}".format(WA))
print("TLE x {}".format(TLE))
print("RE x {}".format(RE))

Solution (Python):
N = int(input())
ans = [input() for i in range(N)]

AC= 0
WA = 0
TLE = 0
RE = 0

for i in range(len(ans)):
    if ans[i] == 'AC':
        AC += 1
    elif ans[i] == 'WA':
        WA += 1
    elif ans[i] == 'TLE':
        TLE += 1
    else:
        RE += 1

print('AC x',AC)
print('WA x',WA)
print('TLE x',TLE)
print('RE x',RE)

Solution (Python):
N=int(input())
S = [input() for i in range(N)]

a=S.count('AC')
b=S.count('WA')
c=S.count('TLE')
d=S.count('RE')

print("AC x ",a)
print("WA x ",b)
print("TLE x ",c)
print("RE x ",d)

Solution (Python):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif s == "RE":
        re += 1

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)

Solution (Python):
n = int(input())

cnt1 = 0
cnt2 = 0
cnt3 = 0
cnt4 = 0

for i in range(n):
    a = input()
    if a == "AC":
        cnt1 += 1
    elif a == "WA":
        cnt2 += 1
    elif a == "TLE":
        cnt3 += 1
    elif a == "RE":
        cnt4 += 1

print("AC x %d" %(cnt1))
print("WA x %d" %(cnt2))
print("TLE x %d" %(cnt3))
print("RE x %d" %(cnt4))

Solution (Python):
N=input()
N=int(N)

S=[]
N_AC=0
N_WA=0
N_TLE=0
N_RE=0

for i in range(0,N,1):
  ip=input()
  S.append(ip)
  if ip=="AC":
    N_AC+=1
  elif ip=="WA":
    N_WA+=1
  elif ip=="TLE":
    N_TLE+=1
  else:
    N_RE+=1

print("AC x "+str(N_AC))
print("WA x "+str(N_WA))
print("TLE x "+str(N_TLE))
print("RE x "+str(N_RE))

Solution (Python):
n = int(input())
l = []
for x in range(0,n):
	l.append(input())
print(f'AC x {l.count("AC")}')
print(f'WA x {l.count("WA")}')
print(f'TLE x {l.count("TLE")}')
print(f'RE x {l.count("RE")}')

Solution (Python):
n = int(input())
s = [input() for _ in range(n)]


print('AC x ' + str(s.count('AC')))
print('WA x ' + str(s.count('WA')))
print('TLE x ' + str(s.count('TLE')))
print('RE x ' + str(s.count('RE')))

Solution (Python):
n = int(input())

l_r = ["AC","WA","TLE","RE"]

ac,wa,tle,re = 0,0,0,0
l_s = [ac,wa,tle,re]

for i in range(n):
  x = str(input())
  if x == l_r[0]:
    ac += 1
    l_s[0] = ac
  if x == l_r[1]:
    wa += 1
    l_s[1] = wa
  if x == l_r[2]:
    tle += 1
    l_s[2] = tle
  if x == l_r[3]:
    re += 1
    l_s[3] = re

for j in range(4):
  print(l_r[j]," x ",l_s[j])

Solution (Python):
n = int(input())
string_list=[input() for i in range(n)]

AC=string_list.count('AC')
WA=string_list.count('WA')
TLE=string_list.count('TLE')
RE=string_list.count('RE')
print('AC x '+str(AC))
print('WA x '+str(WA))
print('TLE x '+str(TLE))
print('RE x '+str(RE))

Solution (Python):
N = int(input())
S = [input() for i in range(N)]

c = 0
w = 0
t = 0
r = 0


for j in range(N):
	if S[j] == "AC":
		c += 1
	elif S[j] == "WA":
		w += 1
	elif S[j] == "TLE":
		t += 1
	elif S[j] == "RE":
		r += 1
		
print("AC x " + str(c))
print("WA x " + str(w))
print("TLE x " + str(t))
print("RE x " + str(r))

Solution (Python):
N = int(input())
A  = [input() for _ in range(N)]
c0=A.count("AC")
c1=A.count("WA")
c2=A.count("TLE")
c3=A.count("RE")
print("AC x",c0)
print("WA x",c1)
print("TLE x",c2)
print("RE x",c3)