from collections import Counter
from math import sqrt
import math

n = int(input())
a = []
b = ["AC" , "TLE" , "WA" , "RE"]
for i in range(n):
    a.append(input())
c = Counter(a)
for i in b:
    print(i , " x ",  c[i])