n=int(input())
Ac=0
Wa=0
Tle=0
Re=0
for i in range(n):
    s=input()
    if s=='AC':
        Ac+=1
    elif s=='WA':
        Wa+=1
    elif s=='TLE':
        Tle+=1
    elif s=='Re':
        Re+=1
print('AC x {}'.format(Ac))
print('WA x {}'.format(Wa))
print('TLE x {}'.format(Tle))
print('RE x {}'.format(Re))