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

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