n = int(input())
ac = 0
wa = 0
tle = 0
we = 0
for i in range(n):
    if input() == "AC":
        ac += 1
        continue
        
    if input() == "WA":
        wa += 1
        continue
        
    if input() == "TLE":
        tle += 1
        continue
    if input() == "WE":
        we += 1
        continue

print("AC x {ac}")
print("WA x {wa}")
print("TLE x {tle}")
print("WE x {we}")