AC = WA = TLE = RE = 0
N = int(input()) #1行目のNを取得する

s = [input() for i in range(N)] #複数行の数値の入力を取得

for v in s:
    if(v == "AC"):
        AC+=1
    elif(v == "WA"):
        WA+=1
    elif(v == "TLE"):
        TLE+=1
    else:
        RE+=1
        
print('AC x %d' % (AC))
print('AC x %d' % (WA))
print('AC x %d' % (TLE))
print('AC x %d' % (RE))