import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

a=ii()
lol=["AC","WA","TLE","RE"]
d=defaultdict(int)
for _ in range(a):
    p=input()
    d[p]+=1
for i in lol:
    print(i,"X",d[i])