import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


n = inp()
ans = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for _ in range(n):
    s = input()[:-1]
    print(s)
    ans[s] += 1

print("AC x {}".format(ans["AC"]))
print("WA x {}".format(ans["WA"]))
print("TLE x {}".format(ans["TLE"]))
print("RE x {}".format(ans["RE"]))
