n=input()
a=[0]*4
for i in range(n):
    s=raw_input()
    if s=="AC":
        a[0]+=1
    elif s=="WA":
        a[1]+=1
    elif s=="TLE":
        a[2]+=1
    else:
        a[3]+=1
print "AC x",a[0]
print "WA x",a[1]
print "TLE x",a[2]
print "RE x",a[3]
