AC_Count = WA_Count = TLE_Count = RE_Count = 0
for _ in range(int(input())):
	s = input()
	if s=="AC":
		AC_Count+=1
	elif s=="WA":
		WA_Count+=1
	elif s=="TLE":
		TLE_Count+=1
	else:
		RE_Count+=1
print("AC "+"x "+AC_count)
print("WA "+"x "+WA_count)
print("TLE "+"x "+TLE_count)
print("RE "+"x "+RE_count)