import collections,sys
def I(): return int(sys.stdin.readline().rstrip())
def S(): return sys.stdin.readline().rstrip()
N = I()
S = [S() for _ in range(N)]
counter_S = collections.defaultdict(int)
for s in S:
    counter_S[s] += 1
print(counter_S)
for ans in ['AC','WA','TLE','RE']:
    print('{0} x {1}'.format(ans,counter_S[ans]))
