import math

def main():

    mp = {
        "AC": 0,
        "TLE": 0,
        "WA": 0,
        "RE": 0
    }

    n = int(input())
    for _ in range(n):
        s = input()
        mp[s]+=1

    for key in mp.keys():
        print(key, "x", mp[key])
main()