def main():

    n = int(input()) 
    verdict = []
    for i in range(n):
        verdict.append(input())
        # AC, WA, TLE, and RE

    print('AC' , 'X' , verdict.count('AC'))
    print('WA' , 'X' , verdict.count('WA'))
    print('TLE' , 'X' , verdict.count('TLE'))
    print('RE' , 'X' , verdict.count('RE'))


if __name__ == "__main__":
    main()