import sys


def main():
    readline = sys.stdin.readline
    N = int(input())
    AC = 0
    WA = 0
    TLE = 0
    RE = 0
    for _ in range(N):
        a = readline()
        if a == "AC":
            AC += 1
        elif a == "WA":
            WA += 1
        elif a == "TLE":
            TLE += 1
        else:
            RE += 1
    print("AC x", AC)
    print("WA x", WA)
    print("TLE x", TLE)
    print("RE x", RE)


if __name__ == "__main__":
    main()
