n = int(eval(input()))

c1 = 0

c2 = 0

c3 = 0

c4 = 0

for i in range(n):

    verd = eval(input())

    if verd == "AC":

        c1 += 1

    elif verd == "WA":

        c2 += 1

    elif verd == "TLE":

        c3 += 1

    else:

        c4 += 1

print(("AC x " + str(c1)))

print(("WA x " + str(c2)))

print(("TLE x " + str(c3)))

print(("RE x " + str(c4)))

from sys import stdin

from collections import defaultdict

inp = lambda : stdin.readline().strip()



t = int(inp())

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

for _ in range(t):

    d[inp()] += 1



for i, j in list(d.items()):

    print((i, 'x', j))
n = int(eval(input()))
c1 = 0
c2 = 0
c3 = 0
c4 = 0
for i in range(n):
    verd = eval(input())
    if verd == "AC":
        c1 += 1
    elif verd == "WA":
        c2 += 1
    elif verd == "TLE":
        c3 += 1
    else:
        c4 += 1
print(("AC x " + str(c1)))
print(("WA x " + str(c2)))
print(("TLE x " + str(c3)))
print(("RE x " + str(c4)))

from sys import stdin
from collections import defaultdict

inp = lambda: stdin.readline().strip()
t = int(inp())
d = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for _ in range(t):
    d[inp()] += 1
for i, j in list(d.items()):
    print((i, "x", j))

-n = int(eval(input())) -c1 = 0 -c2 = 0 -c3 = 0 -c4 = 0 -for i in range(n): -    verd = eval(input()) -    if verd == "AC": -        c1 += 1 -    elif verd == "WA": -        c2 += 1 -    elif verd == "TLE": -        c3 += 1 -    else: -        c4 += 1 -print(("AC x " + str(c1))) -print(("WA x " + str(c2))) -print(("TLE x " + str(c3))) -print(("RE x " + str(c4))) +from sys import stdin +from collections import defaultdict + +inp = lambda: stdin.readline().strip() +t = int(inp()) +d = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0} +for _ in range(t): +    d[inp()] += 1 +for i, j in list(d.items()): +    print((i, "x", j))