N =int(input())
S = []
for i in range(0,N):
  S[i] = input()

AC =0
WA =0
TLE = 0
RE = 0

for j in range(0,N):
  if S[j] == 'AC':AC++
  if S[j] == 'WA':WA++
  if S[j] == 'TLE':TLE++
  if S[j] == 'RE':RE++
print('AC  x  '+str(AC))
print('WA  x  '+str(WA))
print('TLE  x  '+str(TLE))
print('RE  x  '+str(RE))