num = int(input())
a = list(map(int, input().split()))
for i in range(num):
    a[i] = int(a[i])
b = []
for i in range(24):
    b.append(0)
for i in range(num):
    b[a[i]] += 1
for i in range(1, 24):
    print(b[i], end=' ')

17c74be220fc34ad8542df8b956e7d973b8eceee
<mask token>

<mask token>
for i in range(num):
    a[i] = int(a[i])
<mask token>
for i in range(24):
    b.append(0)
for i in range(num):
    b[a[i]] += 1
for i in range(1, 24):
    print(b[i], end=' ')

num = int(input())
a = list(map(int, input().split()))
for i in range(num):
    a[i] = int(a[i])
b = []
for i in range(24):
    b.append(0)
for i in range(num):
    b[a[i]] += 1
for i in range(1, 24):
    print(b[i], end=' ')
