n=int(input())
d={'AC':0,"WA":0,'TLE':0,'RE':0}
for i in range(n):
    s=str(input())
    if(s=='AC'):
        d['AC']=d['AC']+1
    elif(s=='WA'):
        d['WA']=d['WA']+1
    elif(s=='RE'):
        d['RE']=d['RE']+1
    elif(s=='TLE'):
        d['TLE']=d['TLE']+1
print('AC'+" "+"*"+" "+str(d['AC']))
print('WA'+" "+"*"+" "+d['WA'])
print('TLE'+" "+"*"+" "+d['TLE'])
print('RE'+" "+"*"+" "+d['RE'])