Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
edge=[[] for _ in range(n)]
for _ in range(m):
    x,y = map(int,input().split())
    edge[x-1].append(y-1)


d = [0] * n

def dfs(v,edge):
    global depth
    depth = 0
    for next_v in edge[v]:
        if d[next_v] == 0:
            dfs(next_v,edge)
        else:
            depth = max(depth,d[next_v])
    depth += 1 
    d[v] = depth

for i in range(n):
    dfs(i,edge)
print(max(d)-1)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

n,m = map(int,input().split())
edge=[[] for _ in range(n)]
for _ in range(m):
    x,y = map(int,input().split())
    edge[x-1].append(y-1)


d = [0] * n

def dfs(v,edge):
    depth = 0
    for next_v in edge[v]:
        if d[next_v] == 0:
            depth = max(depth,dfs(next_v,edge))
        depth = max(depth,d[next_v])
    depth += 1 
    d[v] = depth
    return depth

for i in range(n):
    dfs(i,edge)
print(max(d)-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
l = list(set(s))
print(max(0,max(s.count(l[i]) - t.count(l[i]) for i in l)))

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

ans = 0

for i in set(s):
    a = sum(k == i for k in s) - sum(k == i for k in t)
    ans = max(a,ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
n,Y = map(int,input().split())
Y = int(Y / 1000)
ans = [-1,-1,-1]
for x in range(n+1):
    for y in range(n+1):
        if 10*x + 5*y + (n-x-y) == Y and n-x-y => 0:
            ans = [x,y,n-x-y]
print(*ans)

Fixed submission:
n,Y = map(int,input().split())
Y = int(Y / 1000)
ans = [-1,-1,-1]
for x in range(n+1):
    for y in range(n+1):
        if 10*x + 5*y + (n-x-y) == Y and n-x-y >= 0:
            ans = [x,y,n-x-y]
print(*ans)
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = list(input())
len_S = int(len(S))
S1 = ' '

if len_S <= K:
  print(K)
else:
  del S[K:]
  for x in S:
    S1 += x
  print(S1 + '...')

Fixed submission:
N = int(input())
a = N % 100
b = a % 10
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
  print('hon')
elif b == 0 or b == 1 or b == 6 or b == 8:
  print('pon')
else:
  print('bon')
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = int(input())
if n == m:
  print("Yes")
else:
  print("No")

Fixed submission:
n, m = map(int, input().split())
if n == m:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n = 3
m = int(input())
if n == m:
    print("Yes")
else:
    print("No")


Fixed submission:
n, m = map(int, input().split())
if n == m:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
k, x = map(int input().split()) 
if 500*k >= x:
  print("Yes")
else:
  print("No")

Fixed submission:
k,x=map(int,input().split())
if k*500>=x:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s, t = input()
print(s + t)


Fixed submission:
s, t = map(str, input().split()) 
print(t + s)

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
print(s + t)

Fixed submission:
s, t = map(str, input().split()) 
print(t + s)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
n = len(s)
res = 0
for i in range(n):
    sum = int(s[i])
    for j in range(i + 1, n):
        num = int(s[j])
        sum = sum * 10 + num
        if sum % 2019 == 0:
            res += 1

print(res)

Fixed submission:
s = input()
n = len(s)
res = 0
sum = 0
c = {}
c[0] = 1
p = 1
for i in range(n - 1, -1, -1):
    sum = (sum + int(s[i]) * p) % 2019
    if sum in c:
        res += c[sum]
    p = (p * 10) % 2019
    c[sum] = c.get(sum, 0) + 1

print(res)
Buggy python submission (verdict: Runtime Error):
x = input()
w = "" 
for i in x: 
    w = i + w 
    if (x==w): 
        print("Yes")
	else:
      	print("No")

Fixed submission:
def palindrom(st):
    return st == st[::-1]
import math
s = input()
l = len(s)
print("Yes" if palindrom(s) and palindrom(s[:(l-1)//2]) and palindrom(s[(l+2)//2:]) else "No")
Buggy python submission (verdict: Runtime Error):
red = int(input())
blue = int(input())
ans = input()
if ans=="blue":
  blue--
else:
  red--
print(red)
print(blue)

Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A, B)

Buggy python submission (verdict: Runtime Error):
red = int(input())
blue = int(input())
ans = input()
if ans=="blue":
  blue--
else:
  red--


Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A, B)
Buggy python submission (verdict: Runtime Error):
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

Fixed submission:
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

Buggy python submission (verdict: Runtime Error):
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

Fixed submission:
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")
Buggy python submission (verdict: Runtime Error):
s = input()
count = 0
first_half, second_half = s[:len(s)//2], s[(len(s)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)


Fixed submission:
s = input()
count = 0
first_half, second_half = s[:len(s)//2], s[(len(s)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(num1,num2):
    if num1 % num2 == 0:
        return num2
    return gcd(num2 , num1 % num2)

N = int(input())
total = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            nums = gcd(i,j)
            total += gcd(nums,k)

print(total)

Fixed submission:
from math import gcd

K = int(input())

memo = []
memolist = []
for i in range(1,K+1):
    if i != 1:
        memo.append(memolist)
    memolist = []
    for j in range(1,K+1):
        memolist.append(gcd(i,j))
memo.append(memolist)

result = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            result += gcd(memo[i-1][j-1],k)

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(num1,num2):
    if num1 % num2 == 0:
        return num2
    return gcd(num2 , num1 % num2)

N = int(input())
total = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            nums = 0
            nums = gcd(i,j)
            total += gcd(nums,k)

print(total)

Fixed submission:
from math import gcd

K = int(input())

memo = []
memolist = []
for i in range(1,K+1):
    if i != 1:
        memo.append(memolist)
    memolist = []
    for j in range(1,K+1):
        memolist.append(gcd(i,j))
memo.append(memolist)

result = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            result += gcd(memo[i-1][j-1],k)

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(num1,num2):
    if num1 % num2 == 0:
        return num2
    return gcd(num2 , num1 % num2)

from functools import reduce

N = int(input())
gcds = []
total = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            nums = 0
            nums = gcd(i,j)
            total += gcd(nums,k)

print(total)

Fixed submission:
from math import gcd

K = int(input())

memo = []
memolist = []
for i in range(1,K+1):
    if i != 1:
        memo.append(memolist)
    memolist = []
    for j in range(1,K+1):
        memolist.append(gcd(i,j))
memo.append(memolist)

result = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            result += gcd(memo[i-1][j-1],k)

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
import math

N = int(input())
gcds = []
num = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            gcds.append(reduce(math.gcd,[i,j,k]))

print(sum(gcds))

Fixed submission:
from math import gcd

K = int(input())

memo = []
memolist = []
for i in range(1,K+1):
    if i != 1:
        memo.append(memolist)
    memolist = []
    for j in range(1,K+1):
        memolist.append(gcd(i,j))
memo.append(memolist)

result = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            result += gcd(memo[i-1][j-1],k)

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())

a = []
a.append(N)

if N % K == 0:
    print(0)
else:
    while True:
        if abs(N - K) not in a:
            a.append(abs(N - K))
            N = abs(N - K)
        else:
            print(min(a))
            break

Fixed submission:
N,K = map(int,input().split())

a = []
a.append(N)

if N % K == 0:
    print(0)
else:
    N = N % K
    while True:
        if abs(N - K) not in a:
            a.append(abs(N - K))
            N = abs(N - K)
        else:
            print(min(a))
            break
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

count = [0 for i in range(N)]

for i in range(N):
    for j in range(N):
        if j < i and S[j] == "W":
            count[i] += 1
        elif j > i and S[j] == "E":
            count[i] += 1
        else:
            pass


print(min(count))

Fixed submission:
N = int(input())
S = input()

wcount = [0 for i in range(N)]
ecount = [0 for i in range(N)]
sumcount = [0 for i in range(N)]

for i in range(1,N):
    if i == 0:
        continue
    elif i > 0 and S[i-1] == "W":
        wcount[i] = wcount[i-1] + 1
    elif i > 0:
        wcount[i] = wcount[i-1]
 
for i in reversed(range(N)):
    if i == N:
        continue
    elif i < N-1 and S[i+1] == "E":
        ecount[i] = ecount[i+1] + 1
    elif i < N-1:
        ecount[i] = ecount[i+1]
    

for i in range(N):
    sumcount[i] = wcount[i] + ecount[i]

print(min(sumcount))
Buggy python submission (verdict: Runtime Error):
0 75 25 100

Fixed submission:
a,b,c,d = map(int,input().split())

length = 0

if b <= c or d <= a:
    length = 0
elif b <= d and c <= d and a <= c:
    length = b - c
elif d <= b and a <= d and c <= a:
    length = d -a
elif b <= d and c <= a:
    length = b - a
elif d <= b and a <= c:
    length = d - c

print (length)
Buggy python submission (verdict: Runtime Error):
K = input()
S = input()

Knum = int(K)
Slength = len(S)

if Slength <= Knum:
	str = S
else:
	str = S[0:Knum]

print(str)

Fixed submission:
n = int(input())
str = ""

if n%10 == 0:
	str = "pon"
elif n%10 == 1:
	str = "pon"
elif n%10 == 2:
	str = "hon"
elif n%10 == 3:
	str = "bon"
elif n%10 == 4:
	str = "hon"
elif n%10 == 5:
	str = "hon"
elif n%10 == 6:
	str = "pon"
elif n%10 == 7:
	str = "hon"
elif n%10 == 8:
	str = "pon"
elif n%10 == 9:
	str = "hon"

print(str)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,D = map(int,input().split())
while True:
    C -= B
    A -= D
    if C == 0:
        print ("Yes")
        break
    if A == 0: 
        print ("No")
        break

Fixed submission:
A,B,C,D = map(int, input().split())
Takahashi=0
Aoki=0
while C-B>0:
    C-=B
    Takahashi+=1
while A-D>0:
    A-=D
    Aoki+=1
print("Yes") if Aoki>=Takahashi else print("No")

Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,D = map(int,input().split())
Takahashi = C - B
Aoki = A - D
if Takahashi == 0: print ("Yes")
if Aoki == 0: print ("No")
else:
    while Takahashi != 0 or Aoki != 0:
        Takahashi -= B
        Aoki -= D
        if Takahashi == 0:
            print ("Yes")
            break
        if Aoki == 0: 
            print ("No")
            break

Fixed submission:
A,B,C,D = map(int, input().split())
Takahashi=0
Aoki=0
while C-B>0:
    C-=B
    Takahashi+=1
while A-D>0:
    A-=D
    Aoki+=1
print("Yes") if Aoki>=Takahashi else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
a = abs(N-K)
if N%K==0: print (0)
else:
    while True:
        c = abs(N-K)
        if c > a: break
        a = c
        N = c
    print(a)

Fixed submission:
N,K = map(int, input().split())
N = N%K
absolute = abs(K-N)
print(absolute if absolute < N else N)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
a = abs(N-K)
if N%K==0 and N > 100: print (0)
else:
    while True:
        c = abs(N-K)
        if c > a: break
        a = c
        N = c
    print(a)

Fixed submission:
N,K = map(int, input().split())
N = N%K
absolute = abs(K-N)
print(absolute if absolute < N else N)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
arr = []
a = abs(N-K)
if N%K==0: print (0)
else:
    while True:
        c = abs(N-K)
        if c > a: break
        a = c
        N = c
    print(a)

Fixed submission:
N,K = map(int, input().split())
N = N%K
absolute = abs(K-N)
print(absolute if absolute < N else N)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
arr = []
while True:
    c = abs(N-K)
    arr.append(c)
    a = set(arr)
    if len(arr) > len(a):
        break
    N = c
print(min(arr))

Fixed submission:
N,K = map(int, input().split())
N = N%K
absolute = abs(K-N)
print(absolute if absolute < N else N)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
a = abs(N-K)
while True:
    c = abs(N-K)
    if c > a: break
    a = c
    N = c
print(a)

Fixed submission:
N,K = map(int, input().split())
N = N%K
absolute = abs(K-N)
print(absolute if absolute < N else N)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
arr=[]
for i in range(N):
    arr.append(input())
s=sorted(set(arr))
max_s = max(arr.count(ele)for ele in s)
for ele in s:
    if arr.count(ele)==max_s:
        print(ele)

Fixed submission:
from collections import Counter
N = int(input())
arr = []
arr_max = []
for i in range(N):
    arr.append(input())
dic = Counter(arr)
inverse = [(value, key) for key, value in dic.items()]
max_s = max(inverse)[0]
for key,value in dic.items():
    if value == max_s: 
        arr_max.append(key)
    else: continue
for j in sorted(arr_max): print (j)
Buggy python submission (verdict: Runtime Error):
S = input()
N = int(input())
count = 0
S = S.split('ABC')
for i in S:
    if i == '':
        count += 1
    else: continue
print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
S = input()
N = int(input())
count = 0
S = S.split('ABC')
for i in S:
    if i == '':
        count += 1
    else: continue
print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
S = input()
N = int(input())
count = 0
a = S.split('ABC')
for i in a:
    if i == '':
        count += 1
    else: continue
print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i in range(1,N-1):
  if S[i-1] + S[i] + s[i+1] == "ABC":
    count = count + 1
print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = int(input)
S = input()
count = 0
for i in range(1,N-1):
  if S[i-1] + S[i] + s[i+1] == "ABC":
    count += 1
	print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
S = input()
N = int(input())
count = 0
if N >= 3 and N <= 50:
	d = ''
	for j in S:
    	d += j
    	if len(d) == N:break
	a = d.split('ABC')
	for i in a:
    	if i == '':
        	count += 1
    	else: continue
print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = int(input)
S = input()
count = 0
if N >= 3 and N <= 50:
	for i in range(1,N-1):
  		if S[i-1] + S[i] + s[i+1] == "ABC":
    	count = count + 1
print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = int(input)
S = input()
count = 0
for i in range(1,N-1):
  if S[i-1] + S[i] + s[i+1] == "ABC":
    count = count + 1
print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i in range(1, N - 1):
  if S[i-1] + S[i] + S[i + 1] = 'ABC':
    count += 1
print (count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
S = input()
N = int(input())
count = 0
d = ''
for j in S:
    d += j
    if len(d) == N:break
a = d.split('ABC')
for i in a:
    if i == '':
        count += 1
    else: continue
print (count)


Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
result = []
i = X
while i >= X:
    for j in range (2, i):
        if (i % j) == 0:
            break
    else:
            result.append(i)
    i += 1
print (min(result))

Fixed submission:
X = int(input())
result = []
for i in range(X,X*2):
    for j in range (2,i):
        if (i % j) == 0:
            break
    else:
            result.append(i)
            a = i
            break
print (a)

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
result = []
for i in range(X,X*2):
    for j in range (2, i):
        if (i % j) == 0:
            break
    else:
            result.append(i)
print (min(result))

Fixed submission:
X = int(input())
result = []
for i in range(X,X*2):
    for j in range (2,i):
        if (i % j) == 0:
            break
    else:
            result.append(i)
            a = i
            break
print (a)

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
result = []
for i in range(X,X*2):
    if i > 1:
        for j in range (2, i):
            if (i % j) == 0:
                break
        else:
            result.append(i)
print (min(result))

Fixed submission:
X = int(input())
result = []
for i in range(X,X*2):
    for j in range (2,i):
        if (i % j) == 0:
            break
    else:
            result.append(i)
            a = i
            break
print (a)

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
result = []
i = X
while i >= X:
    i += 1
    if i > 1:
        for j in range (2, i):
            if (i % j) == 0:
                break
        else:
            result.append(i)
print (min(result))

Fixed submission:
X = int(input())
result = []
for i in range(X,X*2):
    for j in range (2,i):
        if (i % j) == 0:
            break
    else:
            result.append(i)
            a = i
            break
print (a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
count = 0
for i in range(1,N+1):
    n = int(input())
    if n >= K:
        count += 1
    else: continue
print(count)

Fixed submission:
N,K=map(int,input().split())
count = 0
for i in range(1,N+1):
    h = list(map(int,input().split()))
    for j in h:
        if j >= K:
            count += 1
        else: continue
    break
print(count)

Buggy python submission (verdict: Runtime Error):
N = input()
K = input ()
A = int(N)
B = int(K)
j = 0
for i in range(1,A+1):
    n = input()
    a = int(n)
    if a >= B:
        j += 1
    else: continue
print(j)


Fixed submission:
N,K=map(int,input().split())
count = 0
for i in range(1,N+1):
    h = list(map(int,input().split()))
    for j in h:
        if j >= K:
            count += 1
        else: continue
    break
print(count)

Buggy python submission (verdict: Runtime Error):
N = input()
K = input()
A = int(N)
B = int(K)
j = 0
for i in range(1,A+1):
  n = input()
  a = int(n)
  if a >= B:
	j += 1
    continue
  else: continue
print(j)

Fixed submission:
N,K=map(int,input().split())
count = 0
for i in range(1,N+1):
    h = list(map(int,input().split()))
    for j in h:
        if j >= K:
            count += 1
        else: continue
    break
print(count)
Buggy python submission (verdict: Runtime Error):
import math
a,b,h,m = map(int , input().split())
long_needle =(5 * m)/60 + h * 5  
sort_needle = m
ans = math.sqrt(a**2 + b **2 - 2*a*b*abs(math.cos(abs(math.pi*(long_needle-sort_needle))/30))
print(ans)


Fixed submission:
import math
a,b,h,m = map(int , input().split())
long_needle =(5 * m)/60 + h * 5  
sort_needle = m
ans = math.sqrt(a**2 + b **2 - 2*a*b*math.cos(abs(math.pi*(long_needle-sort_needle))/30))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,k = map(int,input().split())
count =0

for i in range(k):
    if(a > 0):
        count += 1
        a -= 1
    elif(b > 0):
        count += 0
        b -= 1
    elif(c > 0):
        count += -1
        c -= 1
print(count)

Fixed submission:
a,b,c,k = map(int,input().split())
count = 0
if(a > k):
    count = k
elif(a + b > k):
    count = a
else:
    tmp = k -(a + b)
    count = a - tmp
print(count)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
all = list(map(int,input().split()))
result = 0

for i in range(m):
    result += all[i]

result = max(-1 ,n-(result))
print(result)

Fixed submission:
n,m = map(int,input().split())
all = list(map(int,input().split()))
result = 0

for i in range(m):
    result += all[i]

result = max(-1 ,n-(result))
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
all = list(map(int,input().split()))

for i in range(1,n+1):
    count = 0
    for j in all:
        if(i == j ):
            count += 1
    print(count)






Fixed submission:
n = int(input())
all = list(map(int,input().split()))
result ={}
for i in range(n):
    result[i] = 0

for i in all:
    result[i-1] += 1

#print(result)
for i in range(n):
    print(result[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
all = list(map(int,input().split()))

for i in range(1,n+1):
    count = 0
    for j in all:
        if(i == j ):
            count += 1
    print(count)






Fixed submission:
n = int(input())
all = list(map(int,input().split()))
result ={}
for i in range(n):
    result[i] = 0

for i in all:
    result[i-1] += 1

#print(result)
for i in range(n):
    print(result[i])