n=int(eval(input()))

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

for _ in range(n): s=eval(input()); d[s]+=1

for k in d: print((k,'x',d[k]))
_,*l=open(0).read().split()

for j in ('AC','WA','TLE','RE'): print((j,'x',l.count(j)))
n = int(eval(input()))
d = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for _ in range(n):
    s = eval(input())
    d[s] += 1
for k in d:
    print((k, "x", d[k]))

_, *l = open(0).read().split()
for j in ("AC", "WA", "TLE", "RE"):
    print((j, "x", l.count(j)))

-n = int(eval(input())) -d = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0} -for _ in range(n): -    s = eval(input()) -    d[s] += 1 -for k in d: -    print((k, "x", d[k])) +_, *l = open(0).read().split() +for j in ("AC", "WA", "TLE", "RE"): +    print((j, "x", l.count(j)))