N = int(input())
for s in range(1,N+1):
  s = list(input().split())
  print(s)
  break
print('AC','x',s.count('AC'))
print('TLE','x',s.count('TLE'))
print('WJ','X',s.count('WJ'))
print('RE','X',s.count('RE'))
