
def main():
    N = int(input())
    cases = dict()
    for _ in range(N):
        s = input()
        cases[s] = cases.get(s, 0) + 1
    
    results = ["AC", "WA", "TLE", "RE"]

    for r in results:
        print(f"{r} x {cases[r]}")
    

if __name__ == '__main__':
    main()
