x=int(input())
cac=0
cwa=0
tle=0
cre=0

for i in range(0,x):
    moji=input()
    if(moji='AC'):
        cac+=1
    if(moji='WA'):
        cwa+=1
    if(moji='TLE'):
        ctle+=1
    if(moji='RE'):
        cre+=1
print('AC x',cac)
print('WA x',cwa)
print('TLE x',ctle)
print('RE x',cre)