N = int(input())
S = []
for i in range(N):
    a = input()
    S.append(a)

C0 = 0
C1 = 0
C2 = 0
C3 = 0

for i in range(N):
    if i == AC:
        C0 = C0 + 1
    if i == WA:
        C1 = C1 + 1
    if i == TLE:
        C2 = C2 + 1
    if i == RE:
        C3 = C3 + 1

print(C0, C1, C2, C3)
    