A = int(input())
list1 = []
for i in range(A):
  a = input()
  list1.append(a)
b =list1.count('AC')
c =list1.count('TLE')
d =list1.count('RE')
e =list1.count('WA')
print('AC x '+ str(b))
print('WA x '+ str(e))
print('TLE x '+str(c))
print('ARE x '+str(d))
