defB():
    n = int(input())
    s = [list(map(str,input().split())) for i in range(n)]
    import collections
    c = collections.Counter(s)
    ret_l = ["AC","WA","TLE","RE"]
    for t in ret_l:
        print(t +  " x " + str(c[t]))
B()