n=int(input())
a=[0]*4
b=""
for i in range(n):
    b=input()
    if b=="AC":
        a[0]+=1
    elif b=="WA":
        a[1]+=1
    elif b=="TLE":
        a[2]+=1
    elif b==1:
        a[3]+=1

print("AC","x",a[0])
print("WA","x",a[1])
print("TLE","x",a[2])
print("RE","x",a[3])