N = int(input())
a, w, t, r = 0, 0, 0, 0
for i in range(N):
    S = input()
    if S == 'AC':
        a += 1
    elif S == 'WA':
        w += 1
    elif S == 'TLE':
        t += 1
    else:
        r += 1
print('AC * ' + str(a))
print('WA * ' + str(w))
print('SLE * ' + str(t))
print('RE * ' + str(r))