x = [input() for i in range(N)]
AC = 0
WA = 0
TLE = 0
RE = 0
for t in range(N):
    if x[t] == 'AC':
        AC += 1
    elif x[t] == 'WA':
        WA += 1
    elif x[t] == 'TLE':
        TLE += 1
    else:
        RE += 1
print('AC x',AC)
print('WA x',WA)
print('TLE x',TLE)
print('RE x',RE)