import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    n = int(input())
    s = []
    c = [0, 0, 0, 0]
    for _ in range(n):
        s.append(input())
    for result in s:
        if result == "AC":
            c[0] += 1
        if result == "WA":
            c[1] += 1
        if result == "TLE":
            c[2] += 1
        if result == "RE":
            c[3] += 1
    for i in range(4):
        if i == 0:
            print("AC x", c[0])
        if i == 1:
            print("WA x", c[1])
        if i == 0:
            print("TLE x", c[2])
        if i == 0:
            print("RE x", c[3])


if __name__ == '__main__':
    main()
