N = int(input())
S = []
for i in range(N):
    S.append((input()))

ac = str(S.count('AC'))
wa = str(S.count('WA'))
tle = str(S.count('TLE'))
re = str(S.count('TLE'))


ans = 'AC x'+' '+ ac + "\n"+'WA x'+' '+ wa + "\n"+'TLE x' +' '+ tle +"\n" + 'RE x'+' '+re
print(ans)