N = int(input())
for i in range(N):
    S = input().split()
    a = list(S)
    a.append(S)
    i += 1
print("AC" + " x " + str(a.count("AC")))
print("WA"+ " x "+ str(a.count("WA")))
print("TLE" + " x " + str(a.count("TLE")))
print("RE" + " x " + str(a.count("RE")))    
