N = int(input())
G0,G1,G2,G3=0,0,0,0
for i in range(N):
    Si=input()
    if Si == 'AC':
        G0 = G0+1

    elif Si=='WA':
        G1=G1+1

    elif Si=='TLE':
        G2=G2+1
    
    else:
        G3=G3+1
 
print('AC G' +str(G0))
print('WA G' +str(G1))
print('TLE G'+str(G2))
print('RE G' +str(G3))