    N = int(input())
    S = ['-1' for _ in range(N+1)]
    C = {}
    C['AC'] = 0; C['WA'] = 0; C['TLE'] = 0; C['RE'] = 0
    for i in range(N):
        S[i+1] = input()
        C[S[i+1]] += 1
    for case in ['AC', 'WA', 'TLE', 'RE']:
        print('{} x {}'.format(case,str(C[case])))