N = int(input())
S = [0]*N
AC = int(0)
WA = int(0)
TLE = int(0)
RE = int(0)


for i in range(0,N):
  S[i] = input()
  if(S[i]=='AC'):
    AC += 1
  if(S[i]=='WA'):
    WA += 1
  if(S[i]=='TLE'):
    TLE += 1
  if(S[i]=='RE'):
    RE += 1
    
print('AC *', AC)
print('WA *', WA)
print('TLE *', TLE)
print('RE *', RE)