Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,M,K = input().split()

N = int(N)
M = int(M)
K = int(K)

A = list(input().split())
A = [int(c) for c in A]

B = list(input().split())
B = [int(c) for c in B]

i = 0
j = 0

a = 0
b = 0

while j < K:
    if len(A) == 0 and len(B) == 0:
        break
    elif len(A) == 0:
        if j + B[b] <= K:
            j += B[b]
            i += 1
            b += 1
        else:
            break
    elif len(B) == 0:
        if j + A[a] <= K:
            j += A[a]
            i += 1
            a += 1
        else:
            break
    else:
        if A[a] < B[b]:
            if j + A[a] <= K:
                j += A[a]
                i += 1
                a += 1
            else:
                break
        else:
            if j + B[b] <= K:
                j += B[b]
                i += 1
                b += 1
            else:
                break

print(i)

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

N = int(N)
M = int(M)
K = int(K)

A = list(input().split())
A = [int(c) for c in A]

Sum_A = [0]
ele_A = 0
a = 0

while Sum_A[-1] + A[a] <= K:
    ele_A += A[a]
    a += 1
    Sum_A.append(ele_A)
    if a == len(A):
        break

B = list(input().split())
B = [int(c) for c in B]

Sum_B = [0]
ele_B = 0
b = 0

while Sum_B[-1] + B[b] <= K:
    ele_B += B[b]
    b += 1
    Sum_B.append(ele_B)
    if b == len(B):
        break

h = len(Sum_A) - 1
i = 0
j = 0

while h >= 0:
    while Sum_A[h] + Sum_B[i] <= K:
        j = max(j,h + i)
        if i == len(Sum_B) - 1:
            break
        i += 1
    if h == 0:
        break
    h -= 1

print(j)
Buggy python submission (verdict: Runtime Error):
firstString = input()
secondString = input()
diff = 0
for i in range(len(firstString)):
    if firstString[i] != secondString[i]:
        diff += 1
print(diff)

Fixed submission:
input = int(input())
print (input + input ** 2 + input ** 3)

Buggy python submission (verdict: Runtime Error):
input = int(raw_input())
print (input + input ** 2 + input ** 3)

Fixed submission:
input = int(input())
print (input + input ** 2 + input ** 3)

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
count = 0
for i in range(len(s)):
    if(s[i] != t[i]):
        count += 1
print(count)

Fixed submission:
a = int(input())
print(a+(a*a)+a*a*a)

Buggy python submission (verdict: Runtime Error):
s = list(map(str,input().split()))
t = list(map(str,input().split()))
count = 0
for i in range(len(s)):
    if(s[i] != t[i]):
        count += 1
print(count)

Fixed submission:
a = int(input())
print(a+(a*a)+a*a*a)
Buggy python submission (verdict: Runtime Error):
s = list(map(str,input().split()))
t = list(map(str,input().split()))
count = 0
for i in range(len(s)):
    if(s[i] == t[i]):
        count ++
print(count)

Fixed submission:
s = input()
t = input()
count = 0
for i in range(len(s)):
    if s[i] != t[i]:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
sum = 1
for i in range(n):
    sum = sum * a[i]

if sum > 10**18:
    print('-1')
else:
    print(sum)



Fixed submission:
n = int(input())
a = list(map(int,input().split()))
sum = 1
if 0 in a:
    sum = 0
    print(sum)
    exit()
for i in range(n):
    if sum == 0:
        break
    sum = sum * a[i]
    if sum > 10**18:
        sum = -1
        break
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
sum = 1
for i in range(n):
    sum = sum * a[i]
if sum > 10**18:
    print('-1')
else:
    print(sum)



Fixed submission:
n = int(input())
a = list(map(int,input().split()))
sum = 1
if 0 in a:
    sum = 0
    print(sum)
    exit()
for i in range(n):
    if sum == 0:
        break
    sum = sum * a[i]
    if sum > 10**18:
        sum = -1
        break
print(sum)
Buggy python submission (verdict: Runtime Error):
a=int(intput())
print(a+a^2+a^3)

Fixed submission:
a=int(input())
print(a+a**2+a**3)

Buggy python submission (verdict: Runtime Error):
a=int(intput())
a+a^2+a^3

Fixed submission:
a=int(input())
print(a+a**2+a**3)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()

ans = 1
for i in a:
    i = int(i)
    ans = ans * i
if ans > 10 ** 18:
    ans = '-1'
print(ans)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
ans=1
for i in range(n):
    ans*=a[i]
    if ans>10**18:
        print(-1)
        break
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = input().split()

ans = 1
for i in a:
    i = int(i)
    ans = ans * i
    if ans > 10 ** 18:
        ans = '-1'
print(ans)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
ans=1
for i in range(n):
    ans*=a[i]
    if ans>10**18:
        print(-1)
        break
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()

ans = 1
for i in a:
    i = int(i)
    ans = ans * i
    if ans > 10 ** 18:
        ans = -1
print(ans)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
ans=1
for i in range(n):
    ans*=a[i]
    if ans>10**18:
        print(-1)
        break
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, n = map(int, input().split())

x = 0
ans = 0
if n < b:
    x = n
    ans = math.floor(a*x/b) - a * math.floor(x/b)
else:
    x = n - 1
    ans = math.floor(a*x/b) - a * math.floor(x/b)
print(ans)

Fixed submission:
import math
a, b, n = map(int, input().split())

x = 0
ans = 0
if n < b:
    x = n
    ans = math.floor(a*x/b) - a * math.floor(x/b)
else:
    x = b - 1
    ans = math.floor(a*x/b) - a * math.floor(x/b)
print(ans)

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

a, b, n = map(int, input().split())
y = 0
lst = []
for i in range(1, n+1):
    y = math.floor(a*i/b) - a * math.floor(i/b)
    lst.append(y)

print(max(lst))


Fixed submission:
import math
a, b, n = map(int, input().split())

x = 0
ans = 0
if n < b:
    x = n
    ans = math.floor(a*x/b) - a * math.floor(x/b)
else:
    x = b - 1
    ans = math.floor(a*x/b) - a * math.floor(x/b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

k = int(input())
sum_gcd = 0

def gcd(*numbers):
    return reduce(math.gcd, numbers)

for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            d = gcd(a, b, c)
            sum_gcd += d
print(sum_gcd)




Fixed submission:
import math

k = int(input())
rng = range(1, k+1)

gcd_ls = [math.gcd(i, j) for i in rng for j in rng]
ans = [math.gcd(i, l) for i in rng for l in gcd_ls]

print(sum(ans))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

product = a * b

if product % 2 == 0:
    print('Even')
else:
    print('Odd')

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

if a*b%2:
    print('Odd')
else:
    print('Even')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

total = 0
for i in range(1, n+1):
    wa = sum((map(int, str(i))))
    if a <= wa and wa <= b:
        total += wa
print(total)

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

total = 0
for i in range(n+1):
    wa = sum((map(int, str(i))))
    if a <= wa and wa <= b:
        total += i
print(total)
Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = map(int, input().split())

list = [s1, s2, s3]
ball = 0

for item in list:
    if item == 1:
        ball += 1

print(ball)

Fixed submission:
s = list(input())
print(s.count('1'))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = 1
for i in range(1, n+1):
    s = s * i
print(s % (10**9 + 7))

Fixed submission:
n = int(input())
s = 1
x = 10 ** 9 + 7
for i in range(1, n+1):
    s = s * i % x
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
count = 0
for i in range(a, b+1):
    if i % x == 0:
        count += 1
print(count)


Fixed submission:
a,b,x = map(int,input().split())
print(b//x - (a-1)//x)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
count = 0

for i in range(a, b+1):
    if i % x == 0:
        count += 1
print(count)

Fixed submission:
a,b,x = map(int,input().split())
print(b//x - (a-1)//x)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
num=[]
for i in range(100000):
    num.append(A.count(i))

total=sum(A)
for i in range(Q):
    B, C = map(int, input().split())
    print(total + (C - B) * num[B])
    total=total + (C - B) * num[B]
    num[C] += num[B]
    num[B] -= num[B]
    

Fixed submission:
alpha=str(input())
check=alpha.isupper()

if check==True:
    print("A")
else:
    print("a")

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
num=[]
amax=max(A)
for i in range(amax):
    num.append(A.count(i))

total=sum(A)
for i in range(Q):
    B, C = map(int, input().split())
    print(total + (C - B) * num[B])
    total=total + (C - B) * num[B]
    num[C] += num[B]
    num[B] -= num[B]
    

Fixed submission:
alpha=str(input())
check=alpha.isupper()

if check==True:
    print("A")
else:
    print("a")
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
P = list(map(int, input().split()))
differ=[]

if N == 0:
    print(X)
else:
    for i in range(0,100):
        if i not in P:
            differ.append(abs(X - i))
        else:
            differ.append(1000)
    ans = differ.index(min(differ))
    print(ans)


Fixed submission:
X = list(map(int, input().split()))

for i in range(5):
    if X[i] == 0:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A = [int(i) for i in input().split()]
multiple = 1

for i in range(N):
        if A[i]==0:
        break
    multiple = multiple * A[i]
    if (multiple > 18 ** 10):
        break
    
if multiple > 10 ** 18:
    print(-1)
else:
    print(multiple)

Fixed submission:
N=int(input())
A = [int(i) for i in input().split()]

if 0 in A:
    multiple = 0
else:
    multiple = 1
    for i in range(N):
        multiple = multiple * A[i]
        if multiple > 1000000000000000000:
            multiple = -1
            break

print(multiple)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A = [int(i) for i in input().split()]
multiple = 1

for i in range(N):
    multiple = multiple * A[i]

if multiple > 10 ** 18:
    print('-1')
else:
    print(multiple)

Fixed submission:
N=int(input())
A = [int(i) for i in input().split()]

if 0 in A:
    multiple = 0
else:
    multiple = 1
    for i in range(N):
        multiple = multiple * A[i]
        if multiple > 1000000000000000000:
            multiple = -1
            break

print(multiple)
Buggy python submission (verdict: Runtime Error):
a = int(input())
print(a[0])

Fixed submission:
a = input()

result =0

if a[0]=="1":
	result +=1
if a[1]=="1":
	result +=1
if a[2]=="1":
	result +=1
    
print(result)
Buggy python submission (verdict: Runtime Error):
a=input()

print(a+a*a+a*a*a)

Fixed submission:
a=int(input())

print(a+a*a+a*a*a)
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
k=0
for i in range(len(S))
	if S[i]!=T[i]:
    	k+=1
print(k)

Fixed submission:
S=input()
T=input()
k=0
for i in range(len(S)):
  if S[i]!=T[i]:
    k+=1
print(k)

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
k=0
for i in range(len(S))
	if S[i]==T[i]:
    	continue
  	else:
    	k+=1
print(k)

Fixed submission:
S=input()
T=input()
k=0
for i in range(len(S)):
  if S[i]!=T[i]:
    k+=1
print(k)

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
k=0
for i in range(len(S))
	if S[i]==T[i]:
    	continue
  	else:
    	k+=1

print(k)

Fixed submission:
S=input()
T=input()
k=0
for i in range(len(S)):
  if S[i]!=T[i]:
    k+=1
print(k)

Buggy python submission (verdict: Runtime Error):
ソースコード 

Copy
Copy
S=input()
T=input()
k=0
i=0

while i==len(S)
	if S[i]==T[i]:
  	else:
      k+=1
    i+=1
    end

Fixed submission:
S=input()
T=input()
k=0
for i in range(len(S)):
  if S[i]!=T[i]:
    k+=1
print(k)

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
k=0
i=0
while S!=T	
	if S[i]==T[i]:
  	else:
      k+=1
    i+=1

print(k)

Fixed submission:
S=input()
T=input()
k=0
for i in range(len(S)):
  if S[i]!=T[i]:
    k+=1
print(k)
Buggy python submission (verdict: Runtime Error):
r = map(int, input().split())

print(3*r*r)

Fixed submission:
r = int(input())

print(3*r*r)

Buggy python submission (verdict: Runtime Error):
r = input()

print(3*r*r)

Fixed submission:
r = int(input())

print(3*r*r)
Buggy python submission (verdict: Runtime Error):
a = int(input())

print(round(a*a*a+a*a+a)

Fixed submission:
a = int(input())

print(round(a*a*a+a*a+a))
Buggy python submission (verdict: Runtime Error):
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

for i in range(n):
    if i == 0:
        continue
    else:
        a[i] += a[i-1]

for i in range(m):
    if i == 0:
        continue
    else:
        b[i] += b[i - 1]

a = [0]+a
b = [0]+b

i = 0
j = m
ans = 0

while a[i] <= k:
    while b[j] > k-a[i]:
        j -= 1
    ans = i+j
    ans =max(ans,i+j)
    i += 1

print(ans)

Fixed submission:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

for i in range(n):
    if i == 0:
        continue
    else:
        a[i] += a[i-1]

for i in range(m):
    if i == 0:
        continue
    else:
        b[i] += b[i - 1]

a = [0]+a
b = [0]+b

i = 0
j = m
ans = 0

while a[i] <= k:
    while b[j] > k-a[i]:
        j -= 1
        if j<0:
            j=0
            break

    ans =max(ans,i+j)
   
    i += 1
    if i > n:
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
q = int(input())
bc = [list(map(int,input().split())) for i in range(q)]

for i in range(q):
    a = [bc[i][1] if j == bc[i][0] else j for j in a]
    print(sum(a))
    

Fixed submission:
import collections as co
n = int(input())
a = list(map(int,input().split()))
q = int(input())
bc = [list(map(int,input().split())) for i in range(q)]
c = co.Counter(a)
ans = sum(a)
for i in range(q):
    ans += (c[bc[i][0]] * (bc[i][1]-bc[i][0]))
    print(ans)
    c[bc[i][1]] += c[bc[i][0]]
    c[bc[i][0]] = 0
Buggy python submission (verdict: Runtime Error):
x=input().split()
a=int(x[0])
b=round(x[1]*100)

print(int(a*b//100))

Fixed submission:
x=input().split()
a=int(x[0])
b=round(float(x[1])*100)
print(int(a*b//100))

Buggy python submission (verdict: Runtime Error):
a,b=map(float,input().split())


print(int(a*(b*100)/100)

Fixed submission:
x=input().split()
a=int(x[0])
b=round(float(x[1])*100)
print(int(a*b//100))
Buggy python submission (verdict: Runtime Error):
n=int(input())%10

if n == 3:
    print("bon")
elif n==0 or n==1 or n == 6 or n==8:
    print("pon")
else:
    prinh("hon")

Fixed submission:
n=int(input())%10

if n == 3:
    print("bon")
elif n==0 or n==1 or n == 6 or n==8:
    print("pon")
else:
    print("hon")
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = list(map(int,input().split()))

r=[]
h=-1
i=0
while i+1 not in r:
    r.append(i+1)
    i = a[i]-1
    h += 1
    if k == h:
        print(i+1)
        sys.exit()
r.append(i+1)

p = r.index(r[len(r)-1])
q = len(r)-1-r.index(r[len(r)-1])
r_q = r[p:p+q]


if k+1<p:
    print(r[k])
else:
    j = (k+1-p)%q
    print(r_q[j-1])

Fixed submission:
s = input()
t = input()

if t.startswith(s):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n):
    b.append((a.index(i+1))+1)
print(*b)


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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [ int(i) for i in input().split()]
b = []
for i in range(n):
    b.append((a.index(i+1))+1)
print(*b)
    


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = [0 for k in range(n)]
for i in range(n):
    b[a[i]-1] = i+1
print(*b)
Buggy python submission (verdict: Runtime Error):
s = input()
s2 = [*s]
s3 = list(set(s2))
print('yes' if len(s2) == len(s3) else 'no')


Fixed submission:
s = input()
s2 = list(s)
s3 = list(set(s2))
print('yes' if len(s2) == len(s3) else 'no')
Buggy python submission (verdict: Runtime Error):
a=int(input())
print(a+a**2+a***3)

Fixed submission:
a=int(input())
print(a+a**2+a**3)

Buggy python submission (verdict: Runtime Error):
a=int(input())
print(a+a**2+a***3

Fixed submission:
a=int(input())
print(a+a**2+a**3)

Buggy python submission (verdict: Runtime Error):
a*+a**2+a***3

Fixed submission:
a=int(input())
print(a+a**2+a**3)
Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(input().split())
B = list(input().split())

a=0;b=0
cnt=0
while a < len(A) and b < len(B) and K > 0:
  a_ = A[a]
  b_ = B[b]
    
  if a_ > K and b_ > K:
    break
      
  if a_ < b_ and a_ <= K:
    cnt += 1
	K -= a_
    a += 1
  elif a_ >= b_ and b_ <= K:
    cnt += 1
    K -= b_
    b += 1
      
print(cnt)  


Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

A = [0]
B = [0]
ans = 0

for i in range(n):
    A.append(A[i] + a[i])

for i in range(m):
    B.append(B[i] + b[i])

j = m

for i in range(n + 1):
    if A[i] > k:
        break
    while A[i] + B[j] > k:
        j -= 1
    ans = max(ans, i + j)

print(ans)

Buggy python submission (verdict: Runtime Error):
a=0;b=0
cnt=0
while a < len(A) and b < len(B) and K > 0:
	a_ = A[a]
	b_ = B[b]
    
    if a_ > K and b_ > K:
      break
      
    if a_ < b_ and a_ <= K:
		cnt += 1
		K -= a_
        a += 1
	elif a_ >= b_ and b_ <= K:
      cnt += 1
      K -= b_
      b += 1
      
print(cnt)  

Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

A = [0]
B = [0]
ans = 0

for i in range(n):
    A.append(A[i] + a[i])

for i in range(m):
    B.append(B[i] + b[i])

j = m

for i in range(n + 1):
    if A[i] > k:
        break
    while A[i] + B[j] > k:
        j -= 1
    ans = max(ans, i + j)

print(ans)

Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(input().split())
B = list(input().split())

a=0;b=0
cnt=0
while a < len(A) and b < len(B) and K > 0:
	a_ = A[a]
	b_ = B[b]
    
    if a_ > K and b_ > K:
      break
      
    if a_ < b_ and a_ <= K:
		cnt += 1
		K -= a_
		A.pop(0)
	elif a_ >= b_ and b_ <= K:
      cnt += 1
      K -= b_
      B.pop(0)
      
print(cnt)   
      

Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

A = [0]
B = [0]
ans = 0

for i in range(n):
    A.append(A[i] + a[i])

for i in range(m):
    B.append(B[i] + b[i])

j = m

for i in range(n + 1):
    if A[i] > k:
        break
    while A[i] + B[j] > k:
        j -= 1
    ans = max(ans, i + j)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N=map(int,input().split())

Ans=[0]
for i in range(N+1):
    ans=math.floor(A*i/B)-A*(math.floor(i/B))
    Ans.append(ans)
    if Ans[i-1]>Ans[i]:
        break
    else:
        pass
    
#print(Ans)
print(max(Ans))


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

x=min(N,B-1)

Ans=int(A*x/B)-A*int(x/B)
#print(Ans)
print(Ans)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
n=len(s)
a=0
t=1
d=[1]+[0]*2018
 
for i in range(n):
    a+=int(s[n-1-i])*t
    a%=2019
    t*=10
    #t%=2019
    
    d[a]+=1

ans=0
for i in d:
    ans+=i*(i-1)//2
 
print(ans)

Fixed submission:
s=input()
n=len(s)
a=0
t=1
d=[1]+[0]*2018
 
for i in range(n):
    a+=int(s[n-1-i])*t
    a%=2019
    t*=10
    t%=2019
    
    d[a]+=1

ans=0
for i in d:
    ans+=i*(i-1)//2
 
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=list(input())

count=0

for i in range(len(N)-3):
    for j in range(i+4,len(N)+1):
        B=int(''.join(N[i:j]))
        if B%2019==0:
            count+=1
        else:
            pass
print(count)   

Fixed submission:
s=input()
n=len(s)
a=0
t=1
d=[1]+[0]*2018
 
for i in range(n):
    a+=int(s[n-1-i])*t
    a%=2019
    t*=10
    t%=2019
    
    d[a]+=1

ans=0
for i in d:
    ans+=i*(i-1)//2
 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
syain=int(input())
syain2=syain-1
wariate=input().split(' ')
x=[]

for j in range(syain2):
    tmp=0
    for i in wariate:
        if j==int(i)-1:
            tmp+=1
        else:
            pass
    x.append(tmp)
x.append(0)

for i in x:
    print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]
#print(b)
 
for i in range(n-1):
    #print(a[i])
    b[a[i]-1] += 1
    #print(b)
 
for j in range(n):
    print(b[j])

Buggy python submission (verdict: Time Limit Exceeded):
syain=int(input())
syain2=syain-1
#print(syain2)
wariate=input().split(' ')
x=[]

for j in range(syain2):
    #print(j+1)
    tmp=0
    for i in wariate:
        #print(i)
        #if i==syain2-1:
            #print(tmp)
            #x.append(tmp)
        
        if j==int(i)-1:
            tmp+=1
            #print(tmp)
            #x.append(tmp)
        else:
            pass
    x.append(tmp)
x.append(0)

for i in x:
    print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]
#print(b)
 
for i in range(n-1):
    #print(a[i])
    b[a[i]-1] += 1
    #print(b)
 
for j in range(n):
    print(b[j])
Buggy python submission (verdict: Runtime Error):
K=int(input())
nums=[i for i in range(1,10)]
for i in range(K):
    a=nums.pop(0)
    if a%10!=0:
        nums.append(a*10 + %10 - 1)
    
    nums.append(a*10 + a%10)
    
    if a%10!=9:
        nums.append(a*10 + a%10 + 1)

print(a)


Fixed submission:
K=int(input())
nums=[i for i in range(1,10)]
for i in range(K):
    a=nums.pop(0)
    if a%10!=0:
        nums.append(a*10 + a%10 - 1)
    
    nums.append(a*10 + a%10)
    
    if a%10!=9:
        nums.append(a*10 + a%10 + 1)

print(a)

Buggy python submission (verdict: Runtime Error):
K=int(input())
nums=[i for i in range(1,10)]
for i in range(K):
    a=nums.pop(0)
    if a%10!=0:
        nums.append(a*10 + %10 - 1)
    
    nums.append(a*10 + a%10)
    
    if a%10!=9:
        nums.append(a*10 + a%10 + 1)

print(a)


Fixed submission:
K=int(input())
nums=[i for i in range(1,10)]
for i in range(K):
    a=nums.pop(0)
    if a%10!=0:
        nums.append(a*10 + a%10 - 1)
    
    nums.append(a*10 + a%10)
    
    if a%10!=9:
        nums.append(a*10 + a%10 + 1)

print(a)