N = int(input())
out = ["AC","WA","TLE","RE"]
output = [0]*4

print(output)
for _ in range(N):
    S = input()
    if S == out[0]:
        output[0] += 1
    elif S == out[1]:
        output[1] += 1
    elif S == out[2]:
        output[2] += 1
    else:
        output[3] += 1

print(out[0],"x",output[0])
print(out[1],"x",output[1])
print(out[2],"x",output[2])
print(out[3],"x",output[3],end="")