n = int(eval(input()))

a = 0

b = 0

c = 0

d = 0

 

for i in range(n):

    S = str(eval(input()))

    if S == 'AC':

        a += 1

    if S == 'WA':

        b += 1

    if S == 'TLE':

        c += 1

    if S == 'RE':

        d += 1

print(('AC x '+str(a)))

print(('WA x '+str(b)))

print(('TLE x '+str(c)))

print(('RE x '+str(d)))
n=int(eval(input()))

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



ac = 0

wa = 0

tle = 0

re = 0



for i in l:

    if i == 'AC':

        ac += 1

    if i == 'WA':

        wa += 1

    if i == 'TLE':

        tle += 1

    if i == 'RE':

        re += 1



print(('AC x '+str(ac)))

print(('WA x '+str(wa)))

print(('TLE x '+str(tle)))

print(('RE x '+str(re)))
n = int(eval(input()))
a = 0
b = 0
c = 0
d = 0
for i in range(n):
    S = str(eval(input()))
    if S == "AC":
        a += 1
    if S == "WA":
        b += 1
    if S == "TLE":
        c += 1
    if S == "RE":
        d += 1
print(("AC x " + str(a)))
print(("WA x " + str(b)))
print(("TLE x " + str(c)))
print(("RE x " + str(d)))

n = int(eval(input()))
l = [eval(input()) for i in range(n)]
ac = 0
wa = 0
tle = 0
re = 0
for i in l:
    if i == "AC":
        ac += 1
    if i == "WA":
        wa += 1
    if i == "TLE":
        tle += 1
    if i == "RE":
        re += 1
print(("AC x " + str(ac)))
print(("WA x " + str(wa)))
print(("TLE x " + str(tle)))
print(("RE x " + str(re)))

-a = 0 -b = 0 -c = 0 -d = 0 -for i in range(n): -    S = str(eval(input())) -    if S == "AC": -        a += 1 -    if S == "WA": -        b += 1 -    if S == "TLE": -        c += 1 -    if S == "RE": -        d += 1 -print(("AC x " + str(a))) -print(("WA x " + str(b))) -print(("TLE x " + str(c))) -print(("RE x " + str(d))) +l = [eval(input()) for i in range(n)] +ac = 0 +wa = 0 +tle = 0 +re = 0 +for i in l: +    if i == "AC": +        ac += 1 +    if i == "WA": +        wa += 1 +    if i == "TLE": +        tle += 1 +    if i == "RE": +        re += 1 +print(("AC x " + str(ac))) +print(("WA x " + str(wa))) +print(("TLE x " + str(tle))) +print(("RE x " + str(re)))