n = int(input())
ac = "AC"
wa = "WA"
tle = "TLE"
re = "RE"

ans = [0, 0, 0, 0]
for _ in range(n):
    a = input()
    if (a == ac):
        ans[0] += 1
    if (a == wa):
        ans[1] += 1
    if (a == tle):
        ans[2] += 1
    if (a == re):
        ans[3] += 1

print("AC x ",ans[0])
print("WA x ",ans[1])
print("TLC x ",ans[2])
print("RE x ",ans[3])
