N = int(input())
n = [input() for i in range(N)]
count_AC = 0
count_WA = 0
count_TLE = 0
count_RE = 0
for i in n:
    if i == 'AC':
        count_AC += 1
    elif i == 'WA':
        count_WA += 1
    elif i == 'TLE':
        count_WA += 1
    elif i == 'RE':
        count_WA += 1
print('AC x {0}\nWA x {1}\nTLE x {2}\nRE x {3}'.format(count_AC, count_WA, count_TLE, count_RE))