import sys
from collections import defaultdict
from typing import Callable


def main():
    readline: Callable[[], str] = sys.stdin.readline

    memory: defaultdict = defaultdict(int)

    n: int = int(readline().rstrip())
    for _ in range(n):
        s: str = readline().rstrip()
        memory[s] += 1

    for judge in ("AC", "WA", "TLE", "RE");
        print(f"{judge} x {memory[judge]}")

if __name__ == '__main__':
    main()
