n = int(input())
ac_c = 0
wa_c = 0
tle_c = 0
re_c = 0
for i in range(n):
    s = input()
    if s == "AC":
        ac_c += 1
    elif s == "WA":
        wa_c += 1
    elif s == "TLE":
        tle_c += 1
    else:
        re_c +=1
print("AC" +" "+ "x"+" " + str(ac_c))
print("AC" +" "+ "x"+" "+ str(wa_c))
print("AC" +" "+ "x"+" "+ str(tle_c))
print("AC" +" "+ "x"+" "+ str(re_c))