import math
import sys

def main():

    n = int(input())
    s = [input() for i in range(n)]
    c0,c1,c2,c3 = 0,0,0,0
    
    for i in range(n):
        if "AC" in s[i]:
            c0 += 1
        if s[i] in 'WA':
            c1 += 1
        if s[i] in 'TLE':
            c2 += 1
        if s[i] in 'RE':
            c3 += 1
    print("AC x "+str(c0))
    print("TLE x "+str(c1))
    print("TLE x "+str(c2))
    print("RE x "+str(c3))
if __name__ == "__main__":
    main()