N = int(input())
A = 0
W = 0
T = 0
R = 0
S = list()
for i in range(N):
    S[i] = int(input())
for i in range(0,N):
    if S[i] == 'AC':
        A+=1
    if S[i] == 'WA':
        W+=1
    if S[i] == 'TLE':
        T+=1
    if S[i] == 'RE':
        R+=1
  
  
print("AC x {}",format(A))
print("WA x {}",format(W))
print("TLE x {}",format(T))
print("RE x {}",format(R))
