arr=[0]*4
for _ in range(int(input())):
    s=input()
    if s=='AC':
        arr[0]+=1
    elif s=='WA':
        arr[1]+=1
    elif s=='TLE':
        arr[2]+=1
    else:
        arr[3]+=1
print("AC *",arr[0])
print("WA *",arr[1])
print("TLE *",arr[2])
print("RE *",arr[3])