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):
code = ['AC', 'WA', 'TLE', 'RE']
ans = {c: 0 for c in code}
n = int(input())
for _ in range(n):
  s = input()
  ans[s] += 1
  
for c in code:
  print(c+' x '+str(ans[c]))

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

print("AC x " + str(count["AC"]))
print("WA x " + str(count["WA"]))
print("TLE x " + str(count["TLE"]))
print("RE x " + str(count["RE"]))

Solution (Python):
from collections import Counter
n=int(input())
li=[]
for i in range(n):
  s=input()
  li.append(s)
co=Counter(li)
print("AC x "+str(co["AC"])) 
print("WA x "+str(co["WA"])) 
print("TLE x "+str(co["TLE"])) 
print("RE x "+str(co["RE"]))

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

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

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    d = collections.defaultdict(int)
    for i in range(N):
        s = S()
        d[s] += 1
    for s in ['AC', 'WA', 'TLE', 'RE']:
        print('{} x {}'.format(s, d[s]))


main()

Solution (Python):
d = {"AC":0,"WA":0,"TLE":0,"RE":0}
N = int(input())

for i in range(N):
    d[input()] += 1

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

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

dic = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for _ in range(N):
  s = input()
  dic[s] += 1
  
for k in dic:
  print('{} x {}'.format(k,dic[k]))

Solution (Python):
from collections import Counter
N=int(input())
S=[input() for i in range(N)]
a=[0]*4
for i in range(N):
    if S[i]=='AC':
        a[0]+=1
    elif S[i]=='WA':
        a[1]+=1
    elif S[i]=='TLE':
        a[2]+=1
    else:
        a[3]+=1
print('AC','x',a[0])
print('WA','x',a[1])
print('TLE','x',a[2])
print('RE','x',a[3])

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

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

S = []
for _ in range(N):
    S.append(input())

from collections import Counter
ans = Counter(S)
r = ["AC", "WA", "TLE", "RE"]
for i in r:
    print(i,"x",ans[i])

Solution (Python):
N = int(input())
S = [input() for n 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):
import collections

def list_count(l):
    return collections.Counter(l)

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

res=list_count(res)

print("AC x {0}".format(res["AC"]))
print("WA x {0}".format(res["WA"]))
print("TLE x {0}".format(res["TLE"]))
print("RE x {0}".format(res["RE"]))

Solution (Python):
n=int(input())
from collections import Counter
c=Counter([])
z=['AC','WA','TLE','RE']
for i in range(n):
  s=input()
  c[s]+=1
for item in z:
  print (item,end=" ")
  print ("x",end=" ")
  print (c[item])

Solution (Python):
from collections import Counter


def f(x):
    print("{} x {}".format(x, c[x]))


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

c = Counter(s)

f("AC")
f("WA")
f("TLE")
f("RE")

Solution (Python):
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
C = Counter(S)
print('AC x ', end='')
print(C['AC'])
print('WA x ', end='')
print(C['WA'])
print('TLE x ', end='')
print(C['TLE'])
print('RE x ', end='')
print(C['RE'])

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

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

for i in range(n):
    dic[input()]+=1

print("AC x "+str(dic["AC"]))
print("WA x "+str(dic["WA"]))
print("TLE x "+str(dic["TLE"]))
print("RE x "+str(dic["RE"]))

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

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

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

for i 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 "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

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

Solution (Python):
from collections import Counter

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

c = Counter(S)
for i in ['AC', 'WA', 'TLE', 'RE']:
    print('{} x {}'.format(i, c[i]))

Solution (Python):
from collections import defaultdict

N=int(input())
cnt=defaultdict(int)
for _ in range(N):
    S=input()
    cnt[S]+=1

judge=["AC","WA","TLE","RE"]
for key in judge:
    print(key+" x "+str(cnt[key]))

Solution (Python):
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

d = defaultdict(int)
n = readInt()
for i in range(n):
	d[readChar()]+=1

print("AC x",d["AC"])
print("WA x",d["WA"])
print("TLE x",d["TLE"])
print("RE x",d["RE"])

Solution (Python):
from collections import Counter
n = int(input())
arr = [input() for _ in range(n)]


c = Counter(arr)

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

for x in li:
    print("{} x {}".format(x, c[x]))

Solution (Python):
from collections import Counter

N = int(input())
Ss = [input() for _ in range(N)]

C = Counter(Ss)
for s in ["AC", "WA", "TLE", "RE"]:
    if not s in C:
        c = 0
    else:
        c = C[s]
    print("{} x {}".format(s, c))

Solution (Python):
from collections import defaultdict
def main():
    N = int(input())
    d = defaultdict(int)
    for _ in range(N):
        S = input()
        d[S] += 1

    for s in ['AC','WA','TLE','RE']:
        print(s + ' x ' + str(d[s]))
    



if __name__ == "__main__":
    main()

Solution (Python):
import math
import collections
import bisect
from copy import copy


def main():
    ans = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
    N = int(input())
    for i in range(N):
        S = input()
        ans[S] += 1

    for e in ans:
        print("{} x {}".format(e, ans[e]))


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys

def input():
    return sys.stdin.readline()[:-1]

n = int(input())
s_li = [input() for _ in range(n)]

for sc in ['AC', 'WA', 'TLE', 'RE']:
    print(f'{sc} x {s_li.count(sc)}')

Solution (Python):
import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
n = II()
x = 0
y = 0
z = 0
k = 0
for q in range(n):
	s = SI()
	if s == "AC":
		x+=1
	elif s == "WA":
		y+=1
	elif s == "TLE":
		z+=1
	else:
		k+=1
print("AC x "+str(x))
print("WA x "+str(y))
print("TLE x "+str(z))
print("RE x "+str(k))

Solution (Python):
from collections import Counter

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

c = Counter(s)
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())
ret = {"AC":0,
       "WA":0,
       "TLE":0,
       "RE":0
       }
for i in range(n):
    s = input()
    ret[s]+=1

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

Solution (Python):
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd 
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) 


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

import sys
from collections import Counter as cl 

def solve(N: int, S: "List[str]"):
    state = ["AC", "WA", "TLE", "RE"]
    d = cl(S)
    for s in state:
        print(s + " x " + str(d[s]))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    S = [next(tokens) for _ in range(N)]  
    solve(N, S)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
d = {"AC":0, "WA":0, "TLE":0, "RE":0}
for _ in range(n):
    s = input()
    d[s] += 1

for s in ['AC', 'WA', 'TLE', 'RE']:
    print("{} x {}".format(s, d[s]))

Solution (Python):
N=int(input())
L=["AC","WA","TLE","RE"]
ANS=[0,0,0,0]

for i in range(N):
    s=input()
    for j in range(4):
        if s==L[j]:
            ANS[j]+=1


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

Solution (Python):
from collections import Counter
n = int(input())
s = []
for i in range(n):
    s.append(input())
c = Counter(s)
print('AC x', c['AC'])
print('WA x', c['WA'])
print('TLE x', c['TLE'])
print('RE x', c['RE'])

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


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

for _ in range(n):
    s = input()
    dict[s] += 1


for status, count in dict.items():
    print(f"{status} x {count}")

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

for key in dct:
    print(f'{key} x {dct[key]}')

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

Solution (Python):
N = int(input())
counts = dict()
counts["AC"] = 0
counts["WA"] = 0
counts["TLE"] = 0
counts["RE"] = 0
for i in range(N):
    S = input()
    counts[S] += 1
    
stats = ["AC", "WA", "TLE", "RE"]
for e in stats:
    print(e + " x " + str(counts[e]))

Solution (Python):

from collections import defaultdict, deque, Counter, OrderedDict
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline().rstrip())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    N = I()
    S = [input() for _ in range(N)]
    print(f'AC x {S.count("AC")}')
    print(f'WA x {S.count("WA")}')
    print(f'TLE x {S.count("TLE")}')
    print(f'RE x {S.count("RE")}')


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
d=[0]*4
for i in range(n):
    s=input()
    if s=="AC":
        d[0]+=1
    elif s=="WA":
        d[1]+=1
    elif s=="TLE":
        d[2]+=1
    elif s=="RE":
        d[3]+=1
print("AC x "+str(d[0]))
print("WA x "+str(d[1]))
print("TLE x "+str(d[2]))
print("RE x "+str(d[3]))

Solution (Python):
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

c = Counter(S)

for result in ["AC", "WA", "TLE", "RE"]:
    print(result + " x " + str(c[result]))

Solution (Python):


import math; from collections import *
import sys; from functools import reduce


def get_ints(): return map(int, input().strip().split())
def get_list(): return list(get_ints())
def get_string(): return list(input().strip().split())
def printxsp(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")

UGLYMOD = int(1e9)+7; SEXYMOD = 998244353; MAXN = int(1e5)




d = OrderedDict()
d['AC'] = 0
d['WA'] = 0
d['TLE'] = 0
d['RE'] = 0
n = int(input())
for i in range(n):
    d[input()] += 1
for key, val in d.items():
    print(key, 'x', val)

'''
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
THE LOGIC AND APPROACH IS MINE @luctivud ( UDIT GUPTA )
Link may be copy-pasted here if it's taken from other source.
DO NOT PLAGIARISE.
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
'''

Solution (Python):
import collections
N = int(input())
S = [input() for _ in range(N)]
C = collections.Counter(S)
print('AC x {}'.format(C['AC']))
print('WA x {}'.format(C['WA']))
print('TLE x {}'.format(C['TLE']))
print('RE x {}'.format(C['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
    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())
my_dict = dict()

for _ in range(n):
    tmp = input()
    if tmp in my_dict:
        my_dict[tmp] += 1
    else:
        my_dict[tmp] = 1

for item in ['AC', 'WA', 'TLE', 'RE']:
    if item in my_dict:
        print(item + ' x ' + str(my_dict[item]))
    else:
        print(item + ' x ' + str(0))

Solution (Python):
N = int(input())
a = 0
w = 0
t = 0
r = 0
for i in range(N):
    S = input()
    if S == "AC":
        a += 1
    elif S == "WA":
        w += 1
    elif S == "TLE":
        t += 1
    elif S == "RE":
        r += 1
print("AC","x",a)
print("WA","x",w)
print("TLE","x",t)
print("RE","x",r)

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

Solution (Python):
import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

N = INT()
S = [input() for i in range(N)]

C = Counter(S)
print('AC x {0}'.format(C['AC']))
print('WA x {0}'.format(C['WA']))
print('TLE x {0}'.format(C['TLE']))
print('RE x {0}'.format(C['RE']))

Solution (Python):
def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline
    N = int(input())
    d = defaultdict(int)
    for n in range(N):
        d[input().strip()] += 1
    for s in ['AC', 'WA', 'TLE', 'RE']:
        print(s+' x', d[s])

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
S = [input() for i 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(f'AC x {AC}')
print(f'WA x {WA}')
print(f'TLE x {TLE}')
print(f'RE x {RE}')

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

if __name__ == "__main__":
    main()

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    

    
    
    

    n = int(input())
    a,b,c,d = 0, 0, 0, 0
    for _ in range(n):
        s = input().rstrip()
        if s == 'AC':
            a += 1
        elif s == 'WA':
            b += 1
        elif s == 'TLE':
            c += 1
        else:
            d += 1

    print('AC x {}'.format(a))
    print('WA x {}'.format(b))
    print('TLE x {}'.format(c))
    print('RE x {}'.format(d))

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
n_ac = 0
n_wa = 0
n_tle = 0
n_re = 0

for i in range(N):
    s = input()
    if s == "AC":
        n_ac += 1
    elif s == "WA":
        n_wa += 1
    elif s == "TLE":
        n_tle += 1
    else:
        n_re += 1

print("AC x",n_ac)
print("WA x",n_wa)
print("TLE x",n_tle)
print("RE x",n_re)

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

dic = collections.defaultdict(int)

for i in s:
    dic[i]+=1

print("AC x",dic["AC"])
print("WA x",dic["WA"])
print("TLE x",dic["TLE"])
print("RE x",dic["RE"])

Solution (Python):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a,b,c,d=0,0,0,0
for i in range(n):
    s=input()
    if s=="AC":
        a+=1
    elif s=="WA":
        b+=1
    elif s=="TLE":
        c+=1
    else:
        d+=1
print("AC x",a)
print("WA x",b)
print("TLE x",c)
print("RE x",d)

Solution (Python):
n = int(input())
d = {}
d['AC'] = 0
d['WA'] = 0
d['TLE'] = 0
d['RE'] = 0
for i in range(n):
    s = str(input())
    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):
n=int(input())
a=[0,0,0,0]
b=['AC','WA','TLE','RE']
for i in range(n):
    s=input()
    a[b.index(s)]+=1
print('AC x '+str(a[0]))
print('WA x '+str(a[1]))
print('TLE x '+str(a[2]))
print('RE x '+str(a[3]))

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

d = dict()
d['AC'] = 0
d['WA'] = 0
d['TLE'] = 0
d['RE'] = 0

for _ in range(N):
    s = input()
    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):
N = int(input())

a, b, c, d = 0, 0, 0, 0
for _ in range(N):
    s = input()
    if s == "AC":
        a += 1
    elif s == "WA":
        b += 1
    elif s == "TLE":
        c += 1
    elif s == "RE":
        d += 1


def f(s, x):
    print(s, "x", x)


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

Solution (Python):
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10

    N = II()
    r = []
    for i in range(N):
        r.append(input())
    r = Counter(r)
    print('AC x',r['AC'])
    print('WA x',r['WA'])
    print('TLE x',r['TLE'])
    print('RE x',r['RE'])


    
main()

Solution (Python):
N=int(input())
l=["AC","WA","TLE","RE"]
a=[0,0,0,0]
for i in range(N):
    S=input()
    for j in range(4):
        if l[j]==S:
            a[j]+=1
            break
for i in range(4):
    print(f"{l[i]} x {a[i]}")

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

key = ["AC", "WA", "TLE", "RE"]
d = dict()
for x in key:
    d[x] = 0
for x in S:
    d[x] += 1

for x in key:
    print(x, "x", d[x])

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

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


for i in range(n):
  s = input()
  lst[s] += 1

lst_ans = ['AC', 'WA', 'TLE', 'RE']
for i in lst_ans:
  print("{} x {}".format(i, lst[i]))

Solution (Python):
arr = [0, 0, 0, 0]
for _ in range(int(input())):
  s = input()
  arr[{"AC": 0, "WA": 1, "TLE": 2, "RE": 3}[s]] += 1
print("AC x", arr[0])
print("WA x", arr[1])
print("TLE x", arr[2])
print("RE x", arr[3])

Solution (Python):
import math  
from collections import deque  
from typing import Deque, Dict, List, Optional, Tuple, Union  


def main(N: int, S: List[str]):
    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(f"AC x {ac}")
    print(f"WA x {wa}")
    print(f"TLE x {tle}")
    print(f"RE x {re}")


if __name__ == "__main__":
    N = int(input())
    S: List[str] = []
    for _ in range(N):
        S.append(input())
    main(N, S)

Solution (Python):

from collections import*
c = Counter([input() for _ in [None]*int(input())])
for i in ["AC", "WA", "TLE", "RE"]:
    print(i, "x", c.get(i, 0))

Solution (Python):
from collections import Counter

N,*S = open(0).read().split()
sc = Counter(S)
print('AC x ' + str(sc['AC']))
print('WA x ' + str(sc['WA']))
print('TLE x ' + str(sc['TLE']))
print('RE x ' + str(sc['RE']))

Solution (Python):
N = int(input())
K = ['AC', 'WA', 'TLE', 'RE']
D = {k:0 for k in K}
for _ in range(N):
    D[input()]+=1

for k in K:
    print('{} x {}'.format(k, D[k]))

Solution (Python):
from collections import defaultdict
n = int(input())
s = [input() for i in range(n)]
d = defaultdict(int)
for si in s:
    d[si] += 1
print('AC x {}'.format(d['AC']))
print('WA x {}'.format(d['WA']))
print('TLE x {}'.format(d['TLE']))
print('RE x {}'.format(d['RE']))

Solution (Python):
import math
import fractions
import collections
import itertools
N=int(input())
l=[0]*4
for i in range(N):
    s=input()
    if s=="AC":
        l[0]=l[0]+1
    if s=="WA":
        l[1]=l[1]+1
    if s=="TLE":
        l[2]=l[2]+1
    if s=="RE":
        l[3]=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, *s = open(0).read().split()

from collections import Counter

c = Counter(s)

for ch in ['AC', 'WA', 'TLE', 'RE']:
    print(f'{ch} x {c[ch]}')

Solution (Python):


from collections import defaultdict

scores = defaultdict(int)

N = int(input())
for _ in range(N):
    S = input()
    assert(S in ['AC', 'WA', 'TLE', 'RE'])
    scores[S] += 1

print(f"AC x {scores['AC']}")
print(f"WA x {scores['WA']}")
print(f"TLE x {scores['TLE']}")
print(f"RE x {scores['RE']}")

Solution (Python):
n = int(input())
d = {}
for i in range(n):
    t = input()
    if t not in d:
        d[t] = 1
    else:
        d[t] += 1
if "AC" in d:
    print("AC x",d["AC"])
else:
    print("AC x",0)
if "WA" in d:
    print("WA x",d["WA"])
else:
    print("WA x",0)
if "TLE" in d:
    print("TLE x",d["TLE"])
else:
    print("TLE x",0)
if "RE" in d:
    print("RE x",d["RE"])
else:
    print("RE x",0)

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

Solution (Python):
def examA():
    N = I()
    ans = (10000 - N)%1000
    print(ans)
    return

def examB():
    T = ["AC","WA","TLE","RE"]
    N = I()
    S = [SI()for _ in range(N)]

    ans = [0]*4
    for s in S:
        for i in range(4):
            if s==T[i]:
                ans[i] += 1
                break
    for i in range(4):
        print(T[i]+" x "+str(ans[i]))
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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

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())
d = {'AC':0,'WA':0,'TLE':0,'RE':0}
S = [input() for _ in range(N)]
for i in range(N):
    d[S[i]] += 1

for s in ['AC','WA','TLE','RE']:
    print(s+' x '+str(d[s]))

Solution (Python):
def main():
    count = int(input())
    array = [input() for _ in range(count)]
    names = ['AC', 'WA', 'TLE', 'RE']
    for name in names:
        print(f'{name} x {array.count(name)}')


if __name__ == '__main__':
    main()

Solution (Python):
a=0
b=0
c=0
d=0
N=int(input())
for i in range(N):
  S=input()
  if S=="AC":
    a+=1
  elif S=="WA":
    b+=1
  elif S=="TLE":
    c+=1
  elif S=="RE":
    d+=1
print("AC x "+str(a))
print("WA x "+str(b))
print("TLE x "+str(c))
print("RE x "+str(d))

Solution (Python):
import sys
import itertools

import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines



N = int(input())
S = defaultdict(int)
for i in range(N):
    s = input()
    S[s] += 1

print('AC', 'x', S["AC"])
print('WA', 'x', S["WA"])
print('TLE', 'x', S["TLE"])
print('RE', 'x', S["RE"])

Solution (Python):

import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
dd= defaultdict(int)
for _ in range(n):
    dd[input()]+=1

print("AC x", dd["AC"])
print("WA x", dd["WA"])
print("TLE x", dd["TLE"])
print("RE x", dd["RE"])

Solution (Python):
n = int(input())
d = {}
d['AC'] = 0
d['WA'] = 0
d['TLE'] = 0
d['RE'] = 0

for _ in range(n):
	s = input()
	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 sys
input = sys.stdin.readline

n = int(input())
ac = 0; wa = 0; tle = 0; re = 0
for _ in range(n):
    s = input().rstrip()
    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())
d={'AC':0,'WA':0,'TLE':0,'RE':0}
for _ in range(n):
  d[input()]+=1
print('AC x',d['AC'])
print('WA x',d['WA'])
print('TLE x',d['TLE'])
print('RE x',d['RE'])