n = int(input())
p = []
for i in range(n):
    a = input()
    p.append(a)
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
    if p[i] == 'AC':
        ac += 1
    elif p[i] == 'WA':
        wa += 1
    elif p[i] == 'TLE':
        tle += 1
    else:
        re += 1
ans = 'AC X'
print(ans,str(ac), sep = ' ',)
ans = 'WA X'
print(ans,str(wa), sep = ' ')
ans = 'TLE X'
print(ans,str(tle), sep = ' ')
ans = 'RE X'
print(ans,str(re), sep = ' ')