from sys import stdin


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    S_arr = []
    for i in range(N):
        _ = _in[i+1]
        S_arr.append(_)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    c_arr = [0] * 4
    for S in S_arr:
        if S == 'AC':
            c_arr[0] += 1
        elif S == 'WA':
            c_arr[1] += 1
        elif S == 'TLE':
            c_arr[2] += 1
        else:
            c_arr[3] += 1
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(f'AC x{c_arr[0]}')
    print(f'WA x{c_arr[1]}')
    print(f'TLE x{c_arr[2]}')
    print(f'RE x{c_arr[3]}')


if __name__ == "__main__":
    main()
