n = int(input())

hashmap = {
    'AC' : 0,
    'WA' : 0,
    'TLE': 0,
    'RE' : 0
}

while n > 0:
    t = input()
    hashmap[t] = hashmap.get(t, 0) + 1
    n -= 1

for key, val in hashmap.items():
    print(key + "x" + str(val))

