qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
A = [0]*N

print(A)
for i in [int(s) for s in input().split()]:
    A[i-1] +=1

for j in range(N+1):
    print(A[j])

Fixed code:
N = int(input())
A = [0]*N

for i in [int(s) for s in input().split()]:
    A[i-1] +=1

for j in range(N):
    print(A[j])
Buggy code:
N = input()
A = list(map(int, input().split()))

result = [0]*N

for i in range(N-1):
    result[A[i]-1] += 1

for i in range(N):
    print(result[i])

Fixed code:
N = int(input())
A = list(map(int, input().split()))
 
result = [0]*N
 
for i in range(N-1):
    result[A[i]-1] += 1
 
for i in range(N):
    print(result[i])
Buggy code:
N = int(input())
A = list(map(int, input().split()))
assert len(A) == N - 1
count = [0 for i in range(len(A))]
for a in A:
  count[a] += 1
for n in range(N):
  print(count[n])

Fixed code:
N = int(input())
A = list(map(int, input().split()))
assert len(A) == N - 1
count = [0 for i in range(N)]
for a in A:
  count[a-1] += 1
for n in range(N):
  print(count[n])
Buggy code:
n=int(input())
s=list(map(int,input().split()))
k=[0]*n
for i in s:
  k[i]+=1
for i in k:
  print(k[0])

Fixed code:
n=int(input())
s=list(map(int,input().split()))
k=[0]*n
for i in s:
  k[i-1]+=1
for i in k:
  print(i)
Buggy code:
N = int(input())
A = list(map(int,input.split()))

ans = [0]*N

for i in A:
    ans[i-1] += 1

for j in ans:
    print(j)


Fixed code:
N = int(input())
A = list(map(int,input().split()))

ans = [0]*N

for i in A:
    ans[i-1] += 1

for j in ans:
    print(j)
Buggy code:
N=int(input())

A=list(map(int, input().split()))

B=[0]*len(A)

for i in A:
  B[i-1]+=1
  
print([i for i in B])

Fixed code:
N=int(input())

A=list(map(int, input().split()))

B=[0]*(len(A)+1)

for i in A:
  B[i-1]+=1
  
for i in B:
  print(i)
Buggy code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

def main():
    N, *A = map(int, read().split())
    ans = [0] * (N + 1)
    print(ans)
    for a in A:
        ans[a] += 1
    ans = list(map(str, ans))
    print('\n'.join(ans[1:]))
    return

if __name__ == '__main__':
    main()



Fixed code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

def main():
    N, *A = map(int, read().split())
    ans = [0] * (N + 1)
    for a in A:
        ans[a] += 1
    ans = list(map(str, ans))
    print('\n'.join(ans[1:]))
    return

if __name__ == '__main__':
    main()
Buggy code:
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for i in range(n-1):
  ans[a[i]-1] += 1
print(a)
[print(i) for i in ans]

Fixed code:
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for i in range(n-1):
  ans[a[i]-1] += 1
[print(i) for i in ans]
Buggy code:

N = int(input())
A_l = list(map(int, input().split()))

ans_l = [0]*N

i = 0
while i < N-1:
  ans_l[A_l[i]-1] += 1
  i += 1

i=0
while i < N-1:
  print(ans_l[i])
  i += 1


Fixed code:

N = int(input())
A_l = list(map(int, input().split()))

ans_l = [0]*N

i = 0
while i < N-1:
  ans_l[A_l[i]-1] += 1
  i += 1

i=0
while i < N:
  print(ans_l[i])
  i += 1
Buggy code:
N = int(input())
A = list(map(int, input().split()))
worker_list = [0] * N
print(worker_list)
print(A)
for i in range(0, N - 1):
    worker_list[A[i] - 1] += 1

for i in range(N):
    print(str(worker_list[i]))


Fixed code:
N = int(input())
A = list(map(int, input().split()))
worker_list = [0] * N

for i in range(0, N - 1):
    worker_list[A[i] - 1] += 1

for i in range(N):
    print(worker_list[i])
Buggy code:
n = int(input())
A =[int(x) for x in input().split()]
ans = [0] * n
for i in range(n-1):
    ans[A[i]] +=1

for i in ans:
    print(ans[i])

Fixed code:
n = int(input())
A =[int(x) for x in input().split()]
ans = [0] * n
for i in range(n-1):
    ans[A[i]-1] +=1

for i in range(n):
    print(ans[i])
Buggy code:
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]

for i in range(n-1):
  b[a[i]-1] += 1

for j in range(n-1):
  print(b[j])
  

Fixed code:
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]

for i in range(n-1):
  b[a[i]-1] += 1

for j in range(n):
  print(b[j])
Buggy code:
import sys
 
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(get_ints())
def input(): return sys.stdin.readline().strip()

n = int(input())
Arr = get_array()

child = [0]*(n)

for index, value in enumerate(Arr, 2):
	child[value] += 1
   
for i in child:
	print(i)

Fixed code:
import sys

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(get_ints())
def input(): return sys.stdin.readline().strip()


n = int(input())
Arr = get_array()

child = [0] * (n)

for index, value in enumerate(Arr, 2):
    child[value - 1] += 1

for i in child:
    print(i)
Buggy code:
import collections
n = int(input())
a = collections.Counter(list(map(int, input().split())))

for i in range(1,n):
    print(a[i+1])


Fixed code:
import collections
n = int(input())
a = collections.Counter(list(map(int, input().split())))

for i in range(n):
    print(a[i+1])
Buggy code:
N = int(input())
A = map(int,input().split())
c=[]
for i in range N:
  c[i]=0
for j in A:
  c[j-1]+=1

for C in c:
  print(C)
  

Fixed code:
N = int(input())
A = map(int,input().split())
c=[]
for i in range (N):
  c.append(0)
for j in A:
  c[j-1]+=1

for C in c:
  print(C)
Buggy code:
from collections import Counter


N = int(input())
A = list(map(int, input().split()))

c = Counter(A)
print(c)
for i in range(1, N + 1):
    print(c[i])

Fixed code:
import collections
N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
for i in range(1,N+1):
    print(c[i])
Buggy code:
N = int(input())
A = list(map(int, input().split()))
ans = list(A)
for i in range(2, N+1):
    ans[A[i]] += 1
for i in range(N):
    print(ans[i])


Fixed code:
N = int(input())
A = [0,0] + list(map(int,input().split()))

ans = [0 for i in range(N+1)]
for i in range(N+1):
  ans[A[i]] +=1

for i in ans[1:]:
  print(i)
Buggy code:
n=int(input())
a=[int(0)]*n
l=list(map(int,input.().split()))
for i in range(n-1):
	a[l[i]] = a[l[i]] + 1
for i in range(n):
	print(a[i])
    

Fixed code:
n=int(input())
a=list(map(int,input().split()))
ans = [0] * n 
for i in a:
    ans[i-1] += 1

for i in range(n):
    print(ans[i])
Buggy code:
N = int(input())
A = list(map(int,input().split()))
ans = []
for i in range(N):
  ans.append.(0)
for i in range(N-1):
  ans[A[i]] += 1
print(ans)

Fixed code:
N = int(input())
A = list(map(int,input().split()))
ans = []
for i in range(N):
  ans.append(0)
for i in range(N-1):
  ans[A[i]-1] += 1
for i in range(N):
  print(ans[i])
Buggy code:
N=int(input())
A=list(map(int,input().split()))
x=A[0]*N
for i in A:
    x[i-1]+=1
for j in x:
    print(j)

Fixed code:
N=int(input())
A=list(map(int,input().split()))
x=[0]*N
for i in A:
    x[i-1]+=1
for j in x:
    print(j)
Buggy code:
def main():
    N = int( input())
    A = list( map( int, input().split()))
    B = [0]*(N)
    for a in A:
        
        B[a-1] += 1
        print(B)
    print("\n".join( map( str, B)))
if __name__ == '__main__':
    main()


Fixed code:
def main():
    N = int( input())
    A = list( map( int, input().split()))
    B = [0]*(N+1)
    for a in A:
        B[a] += 1
    print("\n".join( map( str, B[1:])))
if __name__ == '__main__':
    main()
Buggy code:
import numpy as np
N = int(input())
A = list(map(int,input().split()))
ans = np.zeros(N)
for i in A:
    ans[i-1] =+1
for i in ans:
    print(int(i))

Fixed code:
import numpy as np
N = int(input())
A = list(map(int,input().split()))
ans = np.zeros(N)
for i in A:
    ans[i-1] +=1
for i in ans:
    print(int(i))
Buggy code:
N = int(input())
A = list(map(int, input().split()))
data = [0 for i in range(N-1)]
for i in range(N-1):
    data[A[i]-1] += 1
for j in range(N-1):
    print(data[j], end = '\n')

Fixed code:
N = int(input())
A = list(map(int, input().split()))
data = [0 for i in range(N)]
for i in range(N-1):
    data[A[i]-1] += 1
for j in range(N):
    print(data[j], end = '\n')
Buggy code:
n=int(input())
t= [0]*(n+1)
l=[int(i) for i in input().split()]
for i in range(2, n+1):
  t[l[i]]+=1
for i in range(1,n+1):
  print(t[i])

Fixed code:
n=int(input())
t= [0]*(n+1)
l=[int(i) for i in input().split()]
for i in l:
  t[i]+=1
for i in range(1,n+1):
  print(t[i])
Buggy code:
import collections

n=int(input())
a = [int(_) for _ in input().split()]

c=collections.Counter(a)
print(c)
for i in range(1,n+1):
    print(c[i])

Fixed code:
import collections

n=int(input())
a = [int(_) for _ in input().split()]

c=collections.Counter(a)
for i in range(1,n+1):
    print(c[i])
Buggy code:
N = int(input())
A = [int(s) for s in input().split(" ")]
R = [0] * (A + 1)
for a in A:
	R[a - 1] += 1
for a in R:
  print(a)

Fixed code:
N = int(input())
A = [int(s) for s in input().split(" ")]
R = [0] * (len(A) + 1)
for a in A:
	R[a - 1] += 1
for a in R:
  print(a)
Buggy code:
N = int( input())
a = list(map(int, input().split(' ')))
l = [0]*N
numpy.sort(a)
for i in a:
  l[i-1] += 1
for i in l:
    print(i)

Fixed code:
import numpy
N = int( input())
a = list(map(int, input().split(' ')))
l = [0]*N
numpy.sort(a)
for i in a:
    l[i-1] += 1
for i in l:
    print(i)
Buggy code:
n,*a,=map(int,open(0).read().split())
d=[0]*n
for i in a:
  d[i-1]+=1
print(*d[1:],sep="\n")  

Fixed code:
n,*a,=map(int,open(0).read().split())
b=[0]*n
for i in a:
    b[i-1]+=1
print(*b,sep="\n")
Buggy code:
n = int(input())
a = list(map(int,input().split()))
l = [0] * n
for i in range(len(a)):
    l[a[i]-1] += 1
    print(l)
for i in l:
    print(i)

Fixed code:
n = int(input())
a = list(map(int,input().split()))
l = [0] * n
for i in range(len(a)):
    l[a[i]-1] += 1
for i in l:
    print(i)
Buggy code:
n = int(input())
a = map(int, input().split(" "))
d = [0 for i in range(n)]
for i in a:
    d[i] += 1
for i in range(1, n):
    print(d[i])

Fixed code:
n = int(input())
a = map(int, input().split(" "))
d = [0 for i in range(n)]
for i in a:
    d[i - 1] += 1
for i in range(n):
    print(d[i])
Buggy code:
import numpy as np

num = int(input())
sup_num = list(map(int,input().split()))
yn_num = list(np.zeros(num))
print(yn_num)
for x in sup_num:
  yn_num[x-1] +=1
print(list(yn_num))

Fixed code:
import numpy as np

num = int(input())
sup_num = list(map(int,input().split()))
yn_num = list(np.zeros(num,dtype=np.int16))

for x in sup_num:
  yn_num[x-1] +=1
for x in yn_num:
  print(x)
Buggy code:
#coding:utf-8
n = int(input())
a = input().split()
lis = [0 for i in range(n)]
count = 0

for i in a:
    lis[i] += 1

for i in lis:
    if count == 0:
        count = 1
        continue
    print("{}".format(i))

Fixed code:
#coding:utf-8
n = int(input())
a = input().split()
lis = [0 for i in range(n)]

for i in a:
    lis[int(i) - 1] += 1

for i in lis:
    print("{}".format(i))
Buggy code:
N = int(input())
s = [0 for i in range(N)]
A = list(map(int, input().split()))
print(s)
for i in A:
    s[i - 1] += 1
print(*s, sep='\n')


Fixed code:
N = int(input())
s = [0 for i in range(N)]
A = list(map(int, input().split()))
for i in A:
    s[i - 1] += 1
print(*s, sep='\n')
Buggy code:
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in range(n):
    l[a[i] - 1] += 1
    
for i in range(n):
    print(l[i])

Fixed code:
n=int(input())
nums=list(map(int,input().split()))
l=[0]*n
for i in nums:
    l[i-1]+=1
for a in l:
    print(a)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
a1=[0]*(n+1)
for i in range(n-1):
    a1[a[i]]+=1
print(a1)
for j in range(1,n+1):
    print(a1[j])


Fixed code:
n=int(input())
a=list(map(int,input().split()))
a1=[0]*(n+1)
for i in range(n-1):
    a1[a[i]]+=1
for j in range(1,n+1):
    print(a1[j])
Buggy code:
import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
l = list(map(int, input().split()))
ANS = [0]*N

for i in range(N-1):
    k = l[i]
    ANS[k] += 1
for i in range(1,N):
    print(ANS[i])

Fixed code:

import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
l = list(map(int, input().split()))
ANS = [0]*N

for i in range(N-1):
    k = l[i]
    ANS[k-1] += 1
for i in range(N):
    print(ANS[i])
Buggy code:
import collections
n=int(input())
a=list(map(int,input().split()))

b=collections.Counter(a)
for i in range(n+1):
    print(b[i])


Fixed code:
import collections
n=int(input())
a=list(map(int,input().split()))

b=collections.Counter(a)
for i in range(1,n+1):
    print(b[i])
Buggy code:
N = int(input())
a = list(map(int, input().split()))
jousi={}
for i in range(N):
    itmp=str(i)
    jousi[itmp]=0
for i in range(N-1):
    atmp=str(a[i])
    jousi[atmp]+=1
for i in range(1,N+1):
    print(jousi[str(i)])


Fixed code:
N = int(input())
a = list(map(int, input().split()))
jousi={}
for i in range(N+1):
    jousi[str(i)]=0

for i in range(N-1):
    jousi[str(a[i])]+=1
    
for i in range(1,N+1):
    print(jousi[str(i)])
Buggy code:
N = int(input())
A = list(map(int,input().split()))


ans =[0] * N


for i in range(N-1):
    ans[A[i]-1]=ans[A[i]-1]+1
    
print(ans)

Fixed code:
N = int(input())
A = list(map(int,input().split()))

ans = [0]*N
for r in A:
  ans[r-1] += 1

for i in range(N):
  print(ans[i])
Buggy code:
n = int(input())
a = list(map(int, input().split()))
arr = [0 for i in range(n)]
for i in a:
    arr[a - 1] += 1
for i in range(n):
    print(arr[i])

Fixed code:
n = int(input())
a = list(map(int, input().split()))
arr = [0 for i in range(n)]
for i in a:
    arr[i - 1] += 1
for i in range(n):
    print(arr[i])
Buggy code:
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in range(n-1):
    l[a[i] - 1] += 1

print(l)


Fixed code:
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in range(n-1):
    l[a[i] - 1] += 1

for j in l:
    print(j)
Buggy code:
import collections
N = int(input())
A = list(map(int, input().split()))
clist = collections.Counter(A)
print(clist)
for i in range(1,N + 1):
  print(clist[i])


Fixed code:
import collections
N = int(input())
A = list(map(int, input().split()))
clist = collections.Counter(A)
for i in range(1,N + 1):
  print(clist[i])
Buggy code:
Num = int(input())
bossNumsList =  list(map(int, input().split()))

bossNums=[]

for i in range(Num):
  bossNums.append(0)


for i in range(Num-1):
  bossNums[bossNumsList[i]-1] += 1

print(bossNums)


Fixed code:
Num = int(input())
bossNumsList =  list(map(int, input().split()))

bossNums=[]

for i in range(Num):
  bossNums.append(0)


for i in range(Num-1):
  bossNums[bossNumsList[i]-1] += 1

for i in range(Num):
  print(bossNums[i])
Buggy code:
n = int(input())
a = list(map(int, input().split()))

ans = [0 for i in range(n)]

for i in range(n - 1):
  b = a[i]
  ans[b - 1] = ans[b-1] + 1

print(ans)


Fixed code:
n = int(input())
a = list(map(int, input().split()))

ans = [0 for i in range(n)]

for i in range(n - 1):
  b = a[i]
  ans[b - 1] = ans[b-1] + 1

for i in range(n):
  print(ans[i])
Buggy code:
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for i in range(n):
    ans[a[i]-1] += 1
for i in range(n):
    print(ans[i])


Fixed code:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in a:
    ans[i-1] += 1
for i in ans:
    print(i)
Buggy code:
n=int(input())
a=[-1,-1]+list(map(int,input().split()))
cnt=[0]*(n+1)
for i in range(2,n+1):
    cnt[a(i)]+=1
    
for i in range(1,n+1):
    print(cnt[i])

Fixed code:
n=int(input())
a=list(map(int,input().split()))
cnt=[0]*n
for i in range(0,n-1):
    cnt[a[i]-1]+=1
for i in range(0,n):
    print(cnt[i])
Buggy code:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
for i in A:
    ans[i-1] += 1
print(ans)

Fixed code:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
for i in A:
    ans[i-1] += 1
for j in ans:
    print(j)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in range(n):
    b[i+1] = 0

for i in range(n):
    b[a[i]+1] += 1

for i in range(n):
    print(b[i+1])

Fixed code:
n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in range(n):
    b[i+1] = 0

for i in range(n-1):
    b[a[i]] += 1

for i in range(n):
    print(b[i+1])
Buggy code:

from collections import Counter
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    C = Counter(A)

    for i in range(1, N+1):
        print(C[i])

if __name__ == "__main__":
    unittest.main()

Fixed code:

from collections import Counter
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    C = Counter(A)

    for i in range(1, N+1):
        print(C[i])

if __name__ == "__main__":
    resolve()
Buggy code:
n=int(input())
l=list(map(int,input().split(" ")))
r=[0]*n
for i in range(len(l)):
    r[l.pop()]+=1
    
for i in range(n-1):
    print(r[i+1])
    

Fixed code:
n=int(input())
l=list(map(int,input().split(" ")))
s=[0]*n
for i in range(len(l)):
    s[l.pop()-1]+=1
    
for i in range(n):
    print(s[i])
Buggy code:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * (N - 1)
for a in A:
    ans[a-1] += 1
for x in ans:
    print(ans)

Fixed code:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
for a in A:
    ans[a-1] += 1
for x in ans:
    print(x)
Buggy code:
M = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
#print(B)
#print(B[])
num = 1

while num <= M:
    print(B[num])
    num += 1

Fixed code:
import collections
M = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
num = 1

while num <= M:
    print(B[num])
    num += 1
Buggy code:
num = int(input())
boss = input().split()

ans_list = [0] * num

for i_boss in boss:
  ans_list[int(i_boss)-1] += 1
  a = list(map(lambda  x: str(x), ans_list))
  print('\n'.join(a))



Fixed code:
num = int(input())
boss = input().split()

ans_list = [0] * num

for i_boss in boss:
    ans_list[int(i_boss)-1] += 1
a = list(map(lambda  x: str(x), ans_list))
print('\n'.join(a))
Buggy code:
import collections
N = int(input())
A_list = list(map(int, input().split()))
ans = collections.Counter(A_list)
for i in range(N):
	print(ans[i])

Fixed code:
import collections
N = int(input())
A_list = list(map(int, input().split()))
ans = collections.Counter(A_list)
for i in range(1, N+1):
	print(ans[i])
Buggy code:
n = int(input())

line = list(map(int, input().strip().split(" ")))

ans = [0 for s in range(n)]

for i in line:
    ans[i] += 1

for i in range(1, n):
    print(ans[i])


Fixed code:
n = int(input())

line = list(map(int, input().strip().split(" ")))

ans = [0 for s in range(n)]

for i in line:
    ans[i - 1] += 1

for i in range(n):
    print(ans[i])
Buggy code:
# C - management

import collections

n = int(input())
A = list(int(x) for x in input().split())

c = collections.Counter(A)

print(c)

for i in range(1, n+1):
    print(c[i])

Fixed code:
# C - management

import collections

n = int(input())
A = list(int(x) for x in input().split())

c = collections.Counter(A)

for i in range(1, n+1):
    print(c[i])
Buggy code:
n = int(input())
dict = {}
for i in map(int, input().split(" ")):
	dict[i] = dict.get(i, 0) + 1

for i in range(n):
	print(dict.get(i, 0))

Fixed code:
n = int(input())
dict = {}
for i in map(int, input().split(" ")):
	dict[i] = dict.get(i, 0) + 1
 
for i in range(1, n + 1):
	print(dict.get(i, 0))
Buggy code:
N = int(input())
numbers = input().strip().split(' ')

boss_dict = [0] * N
for i in range(N - 1):
    boss_num = int(numbers[i])
    boss_dict[boss_num] += 1
    
for boss in boss_dict:
    print(boss)

Fixed code:
N = int(input())
numbers = input().strip().split(' ')

boss_dict = [0] * N
for i in range(N - 1):
    boss_num = int(numbers[i])
    boss_dict[boss_num - 1] += 1

for boss in boss_dict:
    print(boss)
Buggy code:
import collections 

n = int(input())
a = list(map(int, input().split()))

c = collections.Counter(a)
print(c)

for i in range(1, n + 1):
  print(c[i])

Fixed code:
import collections 

n = int(input())
a = list(map(int, input().split()))

c = collections.Counter(a)

for i in range(1, n + 1):
  print(c[i])
Buggy code:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
L = np.zeros(N)
for x in A:
    L[x-1] =+ 1
for y in L:
    print(int(y))

Fixed code:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
L = np.zeros(N)
for x in A:
    L[x-1] += 1
for y in L:
    print(int(y))
Buggy code:
N=int(input())
A=list(map(int,input().split()))

AA=[0]*N
for j in A:
    AA[j-1]+=1

print(i for i in AA)

Fixed code:
N=int(input())
A=list(map(int,input().split()))

AA=[0]*N
for j in A:
    AA[j-1]+=1

for i in AA:
    print(i)
Buggy code:
n =int(input())
s = list(map(int,input().split()))
l =[0]*n
while i < n-2 :
     l[s[i]-1] += 1
     i += 1
for _ in range(n):
     print(l[_])

Fixed code:
n =int(input())
s = list(map(int,input().split()))
l =[0]*n
i = 0
while i < n-1 :
     l[s[i]-1] += 1
     i += 1
for _ in range(n):
     print(l[_])
Buggy code:
n = int(input())

boss_list = map(int, input().split())

employee_list = [0] * (n - 1)

for boss in boss_list:
	employee_list[boss - 1] += 1
	
for employee in employee_list:
	print(employee)


Fixed code:
n = int(input())

boss_list = map(int, input().split())

employee_list = [0] * (n)

for boss in boss_list:
	employee_list[boss - 1] += 1

for employee in employee_list:
	print(employee)
Buggy code:
N = int(input())
A = list(map(int,input().split()))
print(N,A)
n =  [0 for i in range(N) ]
print(n)
for i in A:
    n[i - 1] += 1

for j in n:
    print(j)

Fixed code:
N = int(input())
A = list(map(int,input().split()))
n =  [0 for i in range(N) ]
for i in A:
    n[i - 1] += 1

for j in n:
    print(j)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
import Counter
x=Counter(a)
for i in range(1,n+1):
  print(a[x])

Fixed code:
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
x=Counter(a)
for i in range(1,n+1):
  print(x[i])
Buggy code:
N = int(input())
A = list(map(int,input().split()))
res = rep(0,N)
for i in range(N-1):
  res[A[i]-1] += 1
for i in res:
  print(i)

Fixed code:
N = int(input())
A = list(map(int,input().split()))
res = [0 for i in range(N)]
for i in range(N-1):
  res[A[i]-1] += 1
for i in res:
  print(i)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

b =[0]*n

for i in a:
    b[a[i]-1] += 1

for i in b:
    print(i)

Fixed code:
n=int(input())
s=[0]*n
a=list(map(int,input().split( )))
for i in a:
    s[i-1]+=1
for i in s:
    print(i)
Buggy code:
N = int(input())
a = list(map(int,input().split()))
M = N

mydict = {}
for i in range(N):
    mydict[i] = 0


for i in range(len(a)):
    if a[i] <= N:
        mydict[a[i]-1] += 1 
        N -= 1

for i in range(M):
    print(mydict[i])

Fixed code:
N = int(input())
a = list(map(int,input().split()))
M = N
W = N

mydict = {}
for i in range(N):
    mydict[i] = 0


for i in range(len(a)):
    if M-a[i] <= N:
        mydict[a[i]-1] += 1 
        N -= 1
        M -= a[i]

for i in range(W):
    print(mydict[i])
Buggy code:
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(1, n):
  b[a[i]] += 1

for e in b:
  print(e)

Fixed code:
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n-1):
  b[a[i]-1] += 1
  
for e in b:
  print(e)
Buggy code:
N = int(input())
syain = []
for i in range(N):
	syain.append(0)
x =(input()).split(" ")
xid = [int(s) for s in x]
for t in xid:
	syain[t-1]+=1
print(syain)

Fixed code:
N = int(input())
syain = []
for i in range(N):
	syain.append(0)
x =(input()).split(" ")
xid = [int(s) for s in x]
for t in xid:
	syain[t-1]+=1
for m in syain:
	print(m)
Buggy code:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

l = Counter(A)

for i in range(N):
  if i in l:
    print(l[i])
  else:
    print(0)

Fixed code:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

l = Counter(A)

for i in range(N):
  if i+1 in l:
    print(l[i+1])
  else:
    print(0)
Buggy code:
N=int(input())
A=[int(i) for i in input().split()]
lis=[0 for i in range(N)]
for i in A:
    lis[i-1]+=1
print(lis)

Fixed code:
N=int(input())
A=[int(i) for i in input().split()]
lis=[0 for i in range(N)]
for i in A:
    lis[i-1]+=1
for t in lis:
    print(t)