import sys
sys.setrecursionlimit(10**6)


def main(input, print):
    n = int(input())
    ac = 0
    wa = 0
    tle = 0
    re = 0
    for i in range(n):
        s = input()
        if s == 'AC':
            ac += 1
        if s == 'WA':
            wa += 1
        if s == 'TLE':
            tle += 1
        if s == 'RE':
            re += 1
    print('AC x '+str(ac))
    print('WA x '+str(wa))
    print('TLE x '+str(tle))
    print('RE x '+str(re))


if __name__ == '__main__':
    main(sys.stdin.readline, print)
