N = int(input())
a=b=c=d = 0
for i in range(N):
  char = input()
  if char =='AC':
    a += 1
  if char =='WA':
    b += 1
  if char =='TLE':
    c += 1
  if char =='RE':
    c += 1
print("AC x " +str(a))
print("WA x " +str(b))
print("TLE x " +str(c))
print("RE x " +str(d))