Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from sys import stdin
N,Y=list(map(int,stdin.readline().strip().split()))
YY=abs(Y)
NN=abs(N)
count=YY-NN
if count<0:
   print(NN-YY+1)
elif count==0:print(0)
else:
    if N>0 and Y>0:
        print(count)
    elif N>0 and Y<0:
        print(count+1)
    elif N<0 and Y>0:
        print(count+1)
    else:N<0(count+2)

Fixed submission:
from sys import stdin
N,Y=list(map(int,stdin.readline().strip().split()))
count=0
flag=False
if abs(N)-abs(Y)==0:
    print(1)
    exit()
if N>Y and abs(N)>abs(Y) or N>Y and N<0:
    count+=1
    N*=-1
    flag=True
YY=abs(Y)
NN=abs(N)
ans=0
if YY>NN:
    ans=YY-NN
else:
    ans=NN-YY
N+=ans
if Y==N:
    print(count+ans)
else:
    print(count+ans+1)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
N,Y=list(map(int,stdin.readline().strip().split()))
YY=abs(Y)
NN=abs(N)
count=YY-NN
if count<0:
   print(Y-N)
else:
    if N>0 and Y>0:
        print(count)
    elif N>0 and Y<0:
        print(count+1)
    elif N<0 and Y>0:
        print(count+1)
    else:N<0(count+2)

Fixed submission:
from sys import stdin
N,Y=list(map(int,stdin.readline().strip().split()))
count=0
flag=False
if abs(N)-abs(Y)==0:
    print(1)
    exit()
if N>Y and abs(N)>abs(Y) or N>Y and N<0:
    count+=1
    N*=-1
    flag=True
YY=abs(Y)
NN=abs(N)
ans=0
if YY>NN:
    ans=YY-NN
else:
    ans=NN-YY
N+=ans
if Y==N:
    print(count+ans)
else:
    print(count+ans+1)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
a.append(0)
a.insert(0,0)
diff=[]
for i in range(0,n+1):
	diff.append(a[i+1]-a[i])
for i in range(0,n):
	ans = 0
	for j in range(0,n+1):
		if j==i+1:
			continue
		if j==i:
			ans+=abs(diff[j]+diff[j+1])
		else:
			ans+=abs(diff[j])
	print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.append(0)
a.insert(0,0)
diff=[]
sum=0
for i in range(0,n+1):
	diff.append(a[i+1]-a[i])
	sum+=abs(diff[i])
for i in range(0,n):
	ans=sum+abs(diff[i]+diff[i+1])-(abs(diff[i])+abs(diff[i+1]))
	print(ans)
Buggy python submission (verdict: Runtime Error):
import collections
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

  
  
s=input()

for i in range(s-1)
	c = prime_factorize(s-i-1)
  	a = len(c)
    print(a)
    

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

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a:
    print(0)
else:
    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, c , x = map(int, input().split())
count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range (c+1):
            if i * 500 + j * 100 + k * 50 == x:
                count += 1

print(count)


Fixed submission:
a , b, c , x = [int(input()) for i in range(4)]
count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range (c+1):
            if i * 500 + j * 100 + k * 50 == x:
                count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().strip())
if a * b % 2 == 0:
  print('Even')
else:
  print('Odd')

Fixed submission:
a,b = map(int, input().split())
if a * b % 2 == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
n, y = map(int,input().split())
y = y//1000
for i in range(n+1):
    for j in range (n+1-i):
        k = n - i - j
        if 10*i + 5* j + 1 * k == y:
            print(str(i) +' '+str(j)+' '+str(k))
            syexit()
print('-1 -1 -1')

Fixed submission:
n, y = map(int,input().split())
y = y//1000
for i in range(n+1):
    for j in range (n+1-i):
        k = n - i - j
        if 10*i + 5* j + 1 * k == y:
            print(str(i) +' '+str(j)+' '+str(k))
            exit()
print('-1 -1 -1')
Buggy python submission (verdict: Runtime Error):
s = input()
print(s.count(1))

Fixed submission:
s = input()
print(s.count('1'))

Buggy python submission (verdict: Runtime Error):
a,  b,  c = map(int, input(),split(''))
print(a + b+ c)

Fixed submission:
s = input()
print(s.count('1'))

Buggy python submission (verdict: Runtime Error):
a b c = map(int, input(),split(''))
print(a + b+ c)

Fixed submission:
s = input()
print(s.count('1'))
Buggy python submission (verdict: Runtime Error):
n = int(input())
data = [input().split() for i in range(n)]
light = [0]*n
light[0] = 1
count = 1
bool = False
temp = int(data[0][0])
for i in range(n):
    temp = int(data[temp - 1][0])
    count += 1
    if temp == 2:
        print(count)
        exit()
print(-1)

Fixed submission:
x,a,b = map(int,input().split())
if b <= a:
    print('delicious')
elif b - a <= x:
    print('safe')
else:
    print('dangerous')
Buggy python submission (verdict: Runtime Error):
n = int(input())
data = [input().split() for i in range(n)]
light = [0]*n
light[0] = 1
count = 0
bool = False
for i in range(n):
    temp = light.index(1)
    light[int(data[temp][0])  - 1] = 1
    light[temp] = 0
    if temp == 1:
        bool = True
        print(count)
        exit()
    count += 1
if bool == False:
    print(-1)

Fixed submission:
n = int(input())
data = [int(input()) for i in range(n)]
count = 0
temp = 1
for i in range(n):
    temp = data[temp-1]
    count += 1
    if temp == 2:
        print(count)
        break
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
for i in range(1,n+1):
    ans *= i
print(ans % (10**9 + 7))


Fixed submission:
n = int(input())
import math
print(math.factorial(n) %(10**9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
for i in range(1,n+1):
    ans *= i
print(ans % (10**9 + 7))


Fixed submission:
n = int(input())
import math
print(math.factorial(n) %(10**9 + 7))
Buggy python submission (verdict: Runtime Error):
a,b,x = map(int,input().split())

    print((b - a) // x)

Fixed submission:
a,b,x = map(int,input().split())
if a != 0:
    print(b // x - (a - 1) // x)
else:
    print(b // x + 1)
Buggy python submission (verdict: Runtime Error):
s, t = input().strip().split()
return t + s

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

Buggy python submission (verdict: Runtime Error):
input s, t
return t + s

Fixed submission:
s, t = input().strip().split()
print(t + s)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k]+s[k].lower()+s[k+1:])


Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k]+s.[k]lower()+s[k+1:])


Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k]+lower(s[k])+s[k+1:])


Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy python submission (verdict: Runtime Error):
print(S[:K] + lower(S[K]) + S[K+1:])

Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])
Buggy python submission (verdict: Runtime Error):
(T // A) *B

Fixed submission:
a, b, t = map(int, input().split())
print(int((t+0.5)//a*b))

Buggy python submission (verdict: Runtime Error):
return ((T + 0.5) // A) * B 

Fixed submission:
a, b, t = map(int, input().split())
print(int((t+0.5)//a*b))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(max(a+b, 2a-1, 2b-1))

Fixed submission:
a, b = map(int, input().split())
m = max(a+b, a*2-1, b*2-1)
print(m)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(max(a+b, 2a-1, 2b=1))

Fixed submission:
a, b = map(int, input().split())
m = max(a+b, a*2-1, b*2-1)
print(m)
Buggy python submission (verdict: Runtime Error):
L = []
for i in range(5):
  x = input()
  L.append(x)
K = int(input())
if L[4] - L[0] <= K:
  print('Yay!')
else:
  print(':(')

Fixed submission:
L = []
for i in range(5):
  x = int(input())
  L.append(x)
K = int(input())
if L[4] - L[0] <= K:
  print('Yay!')
else:
  print(':(')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if b % a == 0:
  print(a + b)
else:
  pritn(b - a)

Fixed submission:
a, b = map(int, input().split())
if b % a == 0:
  print(a + b)
else:
  print(b - a)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input())
l = a + b
r = c + d
if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')

Fixed submission:
a, b, c, d = map(int, input().split())
l = a + b
r = c + d
if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int input())
l = a + b
r = c + d
if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')

Fixed submission:
a, b, c, d = map(int, input().split())
l = a + b
r = c + d
if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')
Buggy python submission (verdict: Runtime Error):
x, y = input().split()
d = {'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15}
if d[x] < d[y]:
  print('<')
if d[x] = d[y]:
  print('=')
else:
  print('>')


Fixed submission:
x, y = input().split()
d = {'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15}
if d[x] < d[y]:
  print('<')
elif d[x] == d[y]:
  print('=')
else:
  print('>')

Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())
d = {'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15}
if d[x] < d[y]:
  print('<')
if d[x] = d[y]:
  print('=')
else:
  print('>')


Fixed submission:
x, y = input().split()
d = {'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15}
if d[x] < d[y]:
  print('<')
elif d[x] == d[y]:
  print('=')
else:
  print('>')
Buggy python submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
if abs(z-a) <  abs(z-b):
  print('A')
else:
  print('B')

Fixed submission:
x, a, b = map(int, input().split())
if abs(x-a) <  abs(x-b):
  print('A')
else:
  print('B')
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))

for i in range(K+1):
    if A[i+K]>A[i]:
        print('Yes')
    else:
        print('No')

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

for i in range(N-K):
    if A[i+K]>A[i]:
        print('Yes')
    else:
        print('No')

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

S=1
Q=[]
for i in range(K):
    S=S*A[i]
Q.append(S)
for i in range(N-K):
    S=S/A[i]*A[K+i]
    Q.append(S)
    
for i in range(len(Q)-1):
    if Q[i]<Q[i+1]:
        print('Yes')
    else:
        print('No')

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

for i in range(N-K):
    if A[i+K]>A[i]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
S=sum(A)
Q=int(input())
for i in range(Q):
    B,C=map(int,input().split())
    S=S+(C-B)*A.count(B)
    A = [C if i ==B  else i for i in A]
    print(S)


Fixed submission:
import collections
N=int(input())
A=list(map(int,input().split()))
S=sum(A)
D=collections.Counter(A)
Q=int(input())
for i in range(Q):
    B,C=map(int,input().split())
    S+=(C-B)*D[B]
    D[C]+=D[B]
    D[B]=0
    print(S)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))

for i in range(1,N+1):
    print(A.count(i))

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

b=[0]*N
for c in A:
    b[c-1]+=1

for i in b:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
import math
S=0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            S+=math.gcd(math.gcd(i,j),k)
print(S)

Fixed submission:
K=int(input())
from math import gcd
S=0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            S+=gcd(gcd(i,j),k)
print(S)
Buggy python submission (verdict: Runtime Error):
A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
D=[]
for i in range(M):
    D.append(list(map(int,input().split())))
    
S=min(a)+min(b)
P=[]
for i in range(M):
    P.append(a[D[i][0]-1]+b[D[i][0]-1]-D[i][2])
P.append(S)
print(min(P))

Fixed submission:
A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
D=[]
for i in range(M):
    D.append(list(map(int,input().split())))
    
S=min(a)+min(b)
P=[]
for i in range(M):
    P.append(a[D[i][0]-1]+b[D[i][1]-1]-D[i][2])
P.append(S)
print(min(P))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
Q={}
for i in range(N):
    B=input()
    A.append(B)
    Q[B]=0
    
    
for i in A:
    Q[i]+=1
    
max_Q = [kv[0] for kv in Q.items() if kv[1] == max(Q.values())] ##辞書式でvalueが最大のもののkeyの並び替え
QQ=sorted(max_Q)
for i in range(len(QQ)):
    print(QQ[i])

Fixed submission:
N=int(input())
A=[]
Q={}
for i in range(N):
    B=input()
    A.append(B)
    Q[B]=0
    
for i in A:
    Q[i]+=1
    
a=max(Q.values())
ans=[]
for i in Q:
    if Q[i]==a:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
p=list(map(int,input().split()))

Q=0
for i in range(N):
    if min(p[0:i+1])>=p[i]:
        Q+=1
print(Q)

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

Q=0
min_p=1000000
for i in range(N):
    if min(p[i],min_p)>=p[i]:
        Q+=1
    min_p=min(p[i],min_p)
print(Q)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())

import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A,B))

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

import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(A,B))
Buggy python submission (verdict: Runtime Error):
import numpy as np
a,b,x=map(int,input().split())

V=a**2*b
if x<=V/2:
    alpha=np.arctan(2*x/a/b**2)
    angle=90-alpha/np.pi*180
    print('{:.10f}'.format(angle))
else:
    angle=90-np.arctan(a**3/2/(a**2*b-x))/np.pi*180
    print('{:.10f}'.format(angle))

Fixed submission:
import numpy as np
a,b,x=map(int,input().split())

V=a**2*b
if x==V:
    print('{:.10f}'.format(0))
elif x<=V/2:
    alpha=np.arctan(2*x/a/b**2)
    angle=90-alpha/np.pi*180
    print('{:.10f}'.format(angle))
else:
    angle=90-np.arctan(a**3/2/(a**2*b-x))/np.pi*180
    print('{:.10f}'.format(angle))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))

for i in range(N):
    print(A.index(i+1)+1)

Fixed submission:
import numpy as np
N=int(input())
A=list(map(int,input().split()))
A=np.array(A)
x=np.argsort(A)
for i in x:
    print(i+1)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,K,Q=map(int,input().split())
A=[]
for i in range(Q):
    a=int(input())
    A.append(a)

P=[K]*N
P1=np.array(P)
for i in A:
    P1=P1-1
    P1[i-1]=P1[i-1]+1
for i in range(len(P1)):
    if P1[i]>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
S=input()
if S=='Sunny':
    print('Cloudy')
elif S=='Cloudy':
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K,Q=map(int,input().split())
A=[]
for i in range(Q):
    a=int(input())
    A.append(a)

P=[K]*N
P1=np.array(P)
for i in A:
    P1=P1-1
    P1[i-1]=P1[i-1]+1
for i in range(len(P1)):
    if P1[i]>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
import numpy as np
N,K,Q=map(int,input().split())
A=[0]*N
P=[K-Q]*N
for i in range(Q):
    a=int(input())
    A[a-1]=A[a-1]+1
A=np.array(A)
P=np.array(P)
for i in range(N):
    if A[i]+P[i]>0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
import numpy as np
N,K,Q=map(int,input().split())
A=[]
for i in range(Q):
    a=int(input())
    A.append(a)

P=[K]*N
P1=np.array(P)
for i in A:
    P1=P1-1
    P1[i-1]=P1[i-1]+1
for i in range(len(P1)):
    if P1[i]>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
import numpy as np
N,K,Q=map(int,input().split())
A=[0]*N
P=[K-Q]*N
for i in range(Q):
    a=int(input())
    A[a-1]=A[a-1]+1
A=np.array(A)
P=np.array(P)
for i in range(N):
    if A[i]+P[i]>0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
P=0
P+=B[A[0]-1]
for i in range(N-1):
    if A[i]!=N:
        u=B[A[i+1]-1]
        q=C[A[i+1]-2]
        o=u+q
        P+=o
    else:
        u=B[A[i+1]-1]
        P+=u
    
print(P)

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

P=0
P+=B[A[0]-1]
for i in range(N-1):
    if A[i]!=N and A[i+1]==A[i]+1:
        u=B[A[i+1]-1]
        q=C[A[i+1]-2]
        o=u+q
        P+=o
    else:
        u=B[A[i+1]-1]
        P+=u
    
print(int(P))
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))

HH=[H[1]-H[0]]
M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
    K.append(M)
    print(max(K))

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


M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    HH=[H[1]-H[0]]
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
    K.append(M)
    print(max(K))

Buggy python submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))

HH=[0]
M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
K.append(M)
del K[0]
print(max(K))

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


M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    HH=[H[1]-H[0]]
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
    K.append(M)
    print(max(K))

Buggy python submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))

HH=[0]
M=0
K=[]
for i in range(1,N-1):
    HH.append(H[i+1]-H[i])
for i in range(len(HH)):
    if HH[i]<=0:
        M+=1
    else:
        K.append(M)
        M=0
K.append(M)
del K[0]
print(max(K))

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


M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    HH=[H[1]-H[0]]
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
    K.append(M)
    print(max(K))
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=N(N-1)/2
print(S)

Fixed submission:
N=int(input())
S=(N*(N-1))//2
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
X=max(U)
Q=max(A)
for i in range(N):
    if i==A.index(Q):
        print(X)
    else:
        print(Q)

Fixed submission:
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
X=max(U)
Q=max(A)
Z=A.index(Q)
for i in range(N):
    if i==Z:
        print(X)
    else:
        print(Q)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
X=max(U)
Q=max(A)
for i in range(N):
    if i==A.index(Q):
        print(X)
    else:
        print(Q)

Fixed submission:
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
X=max(U)
Q=max(A)
Z=A.index(Q)
for i in range(N):
    if i==Z:
        print(X)
    else:
        print(Q)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
for i in range(N):
    if i==A.index(max(A)):
        print(max(U))
    else:
        print(max(A))

Fixed submission:
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
X=max(U)
Q=max(A)
Z=A.index(Q)
for i in range(N):
    if i==Z:
        print(X)
    else:
        print(Q)

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

for i in range(N):
    print(max(A[0:i]+A[i+1:]))

Fixed submission:
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
X=max(U)
Q=max(A)
Z=A.index(Q)
for i in range(N):
    if i==Z:
        print(X)
    else:
        print(Q)
Buggy python submission (verdict: Runtime Error):
Z=[]
Y=[]
for i in range(5):
    a=int(input())
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)

print(sum(Z)-(10-min(Y)))

Fixed submission:
Z=[]
Y=[]
for i in range(5):
    a=int(input())
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)
if len(Y)==0:
    H=10
else:
    H=min(Y)

print(sum(Z)-(10-H))

Buggy python submission (verdict: Runtime Error):
Z=[]
Q=[]
Y=[]
for i in range(5):
    a=int(input())
    Q.append(a)
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)

print(sum(Z)-(10-min(Y)))

Fixed submission:
Z=[]
Y=[]
for i in range(5):
    a=int(input())
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)
if len(Y)==0:
    H=10
else:
    H=min(Y)

print(sum(Z)-(10-H))

Buggy python submission (verdict: Runtime Error):
Z=[]
Q=[]
Y=[]
for i in range(5):
    a=int(input())
    Q.append(a)
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)

print(sum(Z)-(10-min(Y)))

Fixed submission:
Z=[]
Y=[]
for i in range(5):
    a=int(input())
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)
if len(Y)==0:
    H=10
else:
    H=min(Y)

print(sum(Z)-(10-H))
Buggy python submission (verdict: Runtime Error):
N=int(input())

M=10**9
for i in range(1,N//2+10):
    a=list(str(i))
    b=list(str(N-i))
    #print(a,b)
    k=0
    for q in range(len(a)):
        k+=int(a[q])
    for p in range(len(b)):
        k+=int(b[p])
    M=min(M,k)
print(M)

Fixed submission:
N=int(input())

M=10**9
for i in range(1,N//2+1):
    a=list(str(i))
    b=list(str(N-i))
    #print(a,b)
    k=0
    for q in range(len(a)):
        k+=int(a[q])
    for p in range(len(b)):
        k+=int(b[p])
    M=min(M,k)
print(M)