N = int(input())
S = list(str(input()) for _ in range(N))

print(S)

AC = 0
WA = 0
TLE = 0
RE = 0
for s in S:
    if s =='AC':
        AC +=1
    elif s == 'WA':
        WA +=1
    elif s == 'TLE':
        TLE += 1
    elif s == 'RE':
        RE  +=1

print('AC x {}'.format(str(AC)))
print('WA x {}'.format(str(WA)))
print('TLE x {}'.format(str(TLE)))
print('RE x {}'.format(str(RE)))