from collections import deque
import math
import os
import random
import re
import sys
#n=list(map(int, input().split()))
#n=map(int, input().split())


def main():
	s = input().split()
    n=int(s[0])
    d = {'AC':0,'WA':0,'TLE':0,'RE':0}
    for i in range(n):
        s = input().split()
        d[s[0]]+=1
    for i in d:
        print(i,' x ',d[i])
main()
'''
if __name__ == '__main__':
    main()
'''
 

