Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n, k = map(int,input().split())
As = list(map(int, input().split()))
ans = 1
tmp = -1
for i in range(n-k+1):
    for j in range(k):
        ans= ans*As[k+i-j-1]
    if not tmp==-1:
        if tmp<ans:
            print('Yes')
        else:
            print('No')
    tmp = ans
    ans = 1

Fixed submission:
n, k = map(int,input().split())
As = list(map(int, input().split()))
ans = 1
tmp = -1
for i in range(n-k):
    if As[k+i]>As[i]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
As = list(map(int, input().split()))
ans=1
for val in As:
    if val==0:
        ans=0
        break
    ans=val*ans

if 10**18<ans:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys
n=int(input())
As = list(map(int, input().split()))
ans=1
for val in As:
    if val==0:
        ans=0
        break
for val in As:
    if ans==0:
        break
    if val==0:
        ans=0
        break
    ans=val*ans
    if 10**18<ans:
        ans=-1
        break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
As = list(map(int, input().split()))
ans=1
for val in As:
    ans=val*ans

if 10**18<ans:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys
n=int(input())
As = list(map(int, input().split()))
ans=1
for val in As:
    if val==0:
        ans=0
        break
for val in As:
    if ans==0:
        break
    if val==0:
        ans=0
        break
    ans=val*ans
    if 10**18<ans:
        ans=-1
        break

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


for i in range(len(t)):
    if s[i]=='?':
        if maemozi=='P':
            s[i]='D'
        else:
            s[i]='P'
    maemozi=s[i]


print("".join(s))

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

# maemozi=''
# for i in range(len(t)):
#     if s[i]=='?':
#         if maemozi=='P':
#             s[i]='D'
#         else:
#             if i==len(t)-1:
#                 s[i]='D'
#             elif i==0:
#                 if s[i+1]=='D'or s[i+1]=='?':
#                     s[i]='P'
#                 else:
#                     s[i]='D'
#             else:
#                 if s[i+1]=='P':
#                     s[i]='D'
#                 else:
#                     s[i]='P'
#     maemozi=s[i]
for i in range(len(t)):
    if s[i]=='?':
        s[i]='D'

print("".join(s))
Buggy python submission (verdict: Runtime Error):
import collections
import sys
S = input()[::-1]
    
MOD=2019
X = [0]
for i, s in enumerate(S):
    X.append((X[-1]+int(s)*pow(10,i,MOD))%MOD)
    
c = collections.Counter(X)
ans = 0
for v in C.values():
    ans += v * (v - 1) // 2
print(ans)

Fixed submission:
from collections import Counter
S = input()[::-1]
MOD = 2019

X = [0]
for i, s in enumerate(S):
    X.append((X[-1] + int(s) * pow(10, i, MOD)) % MOD)

C = Counter(X)
ans = 0
for v in C.values():
    ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Runtime Error):
import collections
import sys
S = input()[::-1]
if len(S)<=4:
    print(0)
    sys.exit()
    
MOD=2019
X = [0]
for i, s in enumerate(S):
    X.append((X[-1]+int(s)*pow(10,i,MOD))%MOD)
    
c = collections.Counter(X)
ans = 0
for v in C.values():
    ans += v * (v - 1) // 2
print(ans)

Fixed submission:
from collections import Counter
S = input()[::-1]
MOD = 2019

X = [0]
for i, s in enumerate(S):
    X.append((X[-1] + int(s) * pow(10, i, MOD)) % MOD)

C = Counter(X)
ans = 0
for v in C.values():
    ans += v * (v - 1) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = n

count = 0
for i in range(1,100):
    if n >= 26 ** i:
        n = n - 26 ** i
        count += 1
    else:
        break

a = []
b = list('abcdefghijklmnopqrstuvwxyz')
#print(n,count,n // (26 ** A5))
count2 = 0
while 1:
    #print(n)
    count2 = n // (26 ** count)
    n = n % 26 ** count
    if n < 26 ** count:
        a.append(count2)
    count -= 1
    if count == 0:
        a.append(n-1)
        break
#print(n)
x = [b[a[i]]for i in range(len(a))]
print("".join(x))



Fixed submission:
n = int(input()) - 1

a = []
b = list('abcdefghijklmnopqrstuvwxyz')

if n <= 25:
    print(b[n])
    exit()
count = 0
for i in range(1,100):
    if n >= 26 ** i:
        n = n - 26 ** i
        count += 1
    else:
        break


#print(n,count,n // (26 ** A5))
count2 = 0


while 1:
    #print(n)
    #print(n,count,a)
    if count == 0:
        a.append(n)
        break
    count2 = n // (26 ** count)
    n = n % 26 ** count
    a.append(count2)
    count -= 1

#print(n)
x = [b[a[i]]for i in range(len(a))]
print("".join(x))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = list(map(int,input().split()))
#print(a)
q = int(input())
z = [0 for i in range(100001)]
for i in range(len(a)):
    z[a[i]] += 1

b = []
for _ in range(q):
    b.append(list(map(int,input().split())))
#print(b)


for i in range(q):
    z[b[i][1]] += z[b[i][0]]
    z[b[i][0]] = 0
    #print(z[:5])
    s = 0
    for j in range(len(z)):
        s += j * z[j]
    print(s)

Fixed submission:
n = int(input())

a = list(map(int,input().split()))
#print(a)
q = int(input())
z = [0 for i in range(100001)]
for i in range(len(a)):
    z[a[i]] += 1
x = sum(a)
b = []
for _ in range(q):
    b.append(list(map(int,input().split())))
#print(b)


for i in range(q):
    x += (b[i][1] - b[i][0]) * z[b[i][0]]
    z[b[i][1]] += z[b[i][0]]
    z[b[i][0]] = 0
    print(x)

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

a = input()
#print(a)
q = int(input())

b = []
for _ in range(q):
    b.append(list(input().split(" ")))
#print(b)

d = a.split(' ')
l = len(d)
for i in range(q):
    c = a.replace(b[i][0],b[i][1],100000)
    a = c
    d = a.split(' ')
    s = 0
    for j in range(l):
        s += int(d[j]) 
    print(s)

Fixed submission:
n = int(input())

a = list(map(int,input().split()))
#print(a)
q = int(input())
z = [0 for i in range(100001)]
for i in range(len(a)):
    z[a[i]] += 1
x = sum(a)
b = []
for _ in range(q):
    b.append(list(map(int,input().split())))
#print(b)


for i in range(q):
    x += (b[i][1] - b[i][0]) * z[b[i][0]]
    z[b[i][1]] += z[b[i][0]]
    z[b[i][0]] = 0
    print(x)
Buggy python submission (verdict: Runtime Error):
n = int(input())

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

ans = 1
for _ in range(n):
    if ans >= 10 ** 18:
        print(-1)
        exit()
    ans = ans * a[i]

print(ans)

Fixed submission:
n = int(input())

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

if 0 in a:
    print(0)
    exit()

ans = 1
for i in range(n):
    ans = ans * a[i]

    if ans > 10 ** 18:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())

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

Fixed submission:
n = input()

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

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

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

Fixed submission:
n = input()

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

ans = 0
if k > a:
	ans = ans + a
    k = k - a
else:
	ans = ans + k
    k = 0
if k > b:
    k = k - b
else:
    k = 0
if k > c:
	ans = ans - c
else:
	ans = ans - k
print(ans)

print(ans)


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

ans = 0
if k > a:
    ans = ans + a
    k = k - a
else:
    ans = ans + k
    k = 0
if k > b:
    k = k - b
else:
    k = 0
if k > c:
    ans = ans - c
else:
    ans = ans - k
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,k = map(int,input().split())

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

print(ans)

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

ans = 0
if k > a:
    ans = ans + a
    k = k - a
else:
    ans = ans + k
    k = 0
if k > b:
    k = k - b
else:
    k = 0
if k > c:
    ans = ans - c
else:
    ans = ans - k
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

for i in a:
    if i > n:
        a.pop(i)

ans = 0
for j in range(len(a)):
    for k in range(j+1, len(a)):
        #print(j,k)
        if  a[j] + a[k] == abs(j - k):
           #print(j,k, a[j],a[k])
           ans = ans + 1

print(ans)

Fixed submission:
n = int(input())

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

c = {}
for i in range(n):
    if a[i] + i + 1 not in c.keys():
        c[a[i]+i+1] = 1
    else:
        c[a[i]+i+1] += 1

#print(c)

ans = 0
for i in range(n):
    if i + 1 - a[i] not in c.keys():
        pass
    else:
        ans += c[i + 1 - a[i]]

print(ans)

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

for i in a:
    if i > 2 * (10 ** 5):
        a.pop(i)

ans = 0
for j in range(len(a)):
    for k in range(j+1, len(a)):
        #print(j,k)
        if  a[j] + a[k] == abs(j - k):
           #print(j,k, a[j],a[k])
           ans = ans + 1

print(ans)

Fixed submission:
n = int(input())

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

c = {}
for i in range(n):
    if a[i] + i + 1 not in c.keys():
        c[a[i]+i+1] = 1
    else:
        c[a[i]+i+1] += 1

#print(c)

ans = 0
for i in range(n):
    if i + 1 - a[i] not in c.keys():
        pass
    else:
        ans += c[i + 1 - a[i]]

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = 100

ans  = 0

while a != n:
    #print(a)
    a = math.floor(a * 1.01)
    ans = ans + 1

print(ans)

Fixed submission:
import math
n = int(input())
a = 100

ans  = 0

while a < n:
    #print(a)
    a = math.floor(a * 1.01)
    ans = ans + 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a,b,n = map(int,input().split())
c = max(0,n // b * b - 1)
ans = mmath.floor(a * n / b) - a * math.floor(n / b)
 
print(ans)


Fixed submission:
#copy
import math
a, b, n = list(map(int, input().split()))
x = min(b-1,n)
ans = math.floor(a*x/b)-a*math.floor(x/b)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
a,b,n = map(int,input().split())
c = max(0,n // b * b - 1)
ans = mmath.floor(a * c / b) - a * math.floor(c / b)
 
print(ans)

Fixed submission:
#copy
import math
a, b, n = list(map(int, input().split()))
x = min(b-1,n)
ans = math.floor(a*x/b)-a*math.floor(x/b)
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,n = map(int,input().split())
c = n // b * b
ans=0
if n > b - 1:
    ans = math.floor(a * c / b) - a * math.floor(c / b)

else:
    #for i in range(n):
        #print(i+1)
        #print(math.floor(a * (i+1) / b) - a * math.floor((i+1) / b))
        #if math.floor(a * (i+1) / b) - a * math.floor((i+1) / b) > ans:
        #    ans = math.floor(a * (i+1) / b) - a * math.floor((i+1) / b)
    ans = math.floor(a * n / b) - a * math.floor(n / b)
print(ans)
    

Fixed submission:
#copy
import math
a, b, n = list(map(int, input().split()))
x = min(b-1,n)
ans = math.floor(a*x/b)-a*math.floor(x/b)
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = 1
c = [1 for i in range(n)]
for i in range(1,m+1):
  print(a,a+i)
  c[a-1] = 0
  c[a + i - 1] = 0
  a = c.index(1) + 1
  #print(a)


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

a = 1
b = m - 1
c = m
d = [i for i in range(n + 1)]

for i in range(m):
    if m % 2 == 0 and i < m / 2:
        print(d[a], d[a+b])
        print(d[-a-c],d[-a])
        a = a + 1
        b = b - 2
        c = c - 2

    elif m % 2 != 0 and i < m / 2:
        print(d[-a-c],d[-a])
        if i == (m + 1) / 2 - 1:
            break
        print(d[a], d[a+b])
        a = a + 1
        b = b - 2
        c = c - 2
Buggy python submission (verdict: Runtime Error):
n,m =map(int.input().split())

if n <= m:
  print('unsafe')
else:
  print("safe")

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

if n <= m:
  print('unsafe')
else:
  print("safe")
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

while a =< 0:
  c = c - b
  if c <= 0:
    print('Yes')
    exit()
  a = a - d

print("no")

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

while a > 0:
  c = c - b
  if c <= 0:
    print('Yes')
    exit()
  a = a - d

print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

s = []
for i in range(n):
  a = input()
  if a not in s:
    s.append(a)

print(len(s))

Fixed submission:
n = int(input())

s = []
for i in range(n):
  s.append(input())

print(len(set(s)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for _ in range(n):
    a.append(list(map(int,input().split())))

d = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]

d = sorted(d, key = lambda x: x[1])
#print(d)

b = [-100000000000000000]
c = [0]


for i in range(n):
    for j in range(len(b)):
        if d[i][0] >= b[j]:
            if d[i][1] in b:
                c[b.index(d[i][1])] = c[j] + 1
            else:
                b.append(d[i][1])
                c.append(c[j]+1)
    
#print(b)
#print(c)

print(max(c))
        
    


Fixed submission:
n = int(input())
a = []
for _ in range(n):
    a.append(list(map(int,input().split())))

d = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]

d = sorted(d, key = lambda x: x[1])
#print(d)

b = [-100000000000000000]
c = [0]


for i in range(n):
    for j in range(len(b)):
        if d[i][0] >= b[j]:
            b = [d[i][1]]
            c = [c[j] + 1]
            break

    
    #print(b)
    #print(c)

print(max(c))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for _ in range(n):
    a.append(list(map(int,input().split())))

d = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]

d = sorted(d, key = lambda x: x[1])
#print(d)

b = [-100000000000000000]
c = [0]


for i in range(n):
    for j in range(len(b)):
        if d[i][0] >= b[j]:
            b.append(d[i][1])
            c.append(c[j]+1)
    
#print(b)
#print(c)

print(max(c))
        
    


Fixed submission:
n = int(input())
a = []
for _ in range(n):
    a.append(list(map(int,input().split())))

d = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]

d = sorted(d, key = lambda x: x[1])
#print(d)

b = [-100000000000000000]
c = [0]


for i in range(n):
    for j in range(len(b)):
        if d[i][0] >= b[j]:
            b = [d[i][1]]
            c = [c[j] + 1]
            break

    
    #print(b)
    #print(c)

print(max(c))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = []

for i in range(n):
  for j in range(n):
    if a[j] == i + 1:
      b.append(str(j+1))
      break

print(' '.join(b))



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

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

print(' '.join(b))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = []

for i in range(n):
  for j in range(n):
    if a[j] == i + 1:
      b.append(i+1)
      break

print(' '.join(b))

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

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

print(' '.join(b))
Buggy python submission (verdict: Runtime Error):
s = input()

for i in range(s):
  if s[i] % 2 == 0 and s[i] == 'R':
    s = False
    break
  elif s[i] % 2 == 1 and s[i] == 'L':
    s = False
    break

if s:
  print('Yes')
else:
  print('No')
    

Fixed submission:
s = input()

for i in range(len(s)):
  if i % 2 == 1 and s[i] == 'R':
    s = False
    break
  elif i % 2 == 0 and s[i] == 'L':
    s = False
    break

if s:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())

s = input()

if len(s) == 2 and s[0] != s[-1]:
    print(0)
    exit()

if s == 'LRL' or s == 'RLR':
    print(0)
    exit()

if s[0] == 'L':
  count = s.count('LR')
else:
  count = s.count('RL')

count = count - m

if s[0] != s[-1]:
  print(n - 2 * max(count, 0) - 1 * (count <= 0))

else:
  if count > 0:
    print(n - 2 * count - 1)
  else:
    print(n - 2 - max(count, -1))

Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
n = int(input())

a = map(int,input().split())
b = map(int,input().split())
c = map(int,input().split())

ans = 0
for i in range(n):
  if i >= 1 and a[i - 1] + 1 == a[i]:
    ans += c[i - 1]
  ans += b[i]

print(ans)

Fixed submission:

n = int(input())

a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ans = 0
for i in range(n):
  if i >= 1 and a[i - 1] + 1 == a[i]:
    ans += c[a[i - 1] - 1]
  ans += b[a[i] - 1]

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

count = 0
for i in range(3):
  if a[i] == b[i]:
    count += 1

ptint(count)

Fixed submission:
a = list(input())
b = list(input())

count = 0
for i in range(3):
  if a[i] == b[i]:
    count +=1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
b = int(input())
a = [i for i in range(b)]
if b % 2 == 1:
    print((b-1) * ((b-1) // 2) + ((b-1) // 2))
else:
    print((b - 1) * ((b-1) // 2 + 1))

Fixed submission:
b = int(input())
if b % 2 == 1:
    print((b-1) * ((b-1) // 2) + ((b-1) // 2))
else:
    print((b - 1) * ((b-1) // 2 + 1))

Buggy python submission (verdict: Time Limit Exceeded):
a = [i for i in range(int(input()))]
print(sum(a))

Fixed submission:
b = int(input())
if b % 2 == 1:
    print((b-1) * ((b-1) // 2) + ((b-1) // 2))
else:
    print((b - 1) * ((b-1) // 2 + 1))

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

ans = 0
for i in range(a):
  ans += i
print(ans)

Fixed submission:
b = int(input())
if b % 2 == 1:
    print((b-1) * ((b-1) // 2) + ((b-1) // 2))
else:
    print((b - 1) * ((b-1) // 2 + 1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input()))

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

print(1 / b)

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

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

print(1 / b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sorted()

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

print(b)

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

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

print(b)
Buggy python submission (verdict: Runtime Error):
import heapq

n,m = map(int,input().split())

a = [[] for i in range(m)]
d = []
heapq.heapify(d)

for _ in range(n):
    b,c = map(int,input().split())
    a[b-1].append(-1 * c)

#print(a)

ans = 0
for i in range(m):
    for j in range(len(a[i])):
        heapq.heappush(d,a[i][j])
    ans -= heapq.heappop(d)

print(ans)

Fixed submission:
import heapq

n,m = map(int,input().split())

a = [[] for i in range(100000)]
d = []
heapq.heapify(d)

for _ in range(n):
    b,c = map(int,input().split())
    a[b-1].append(-1 * c)

#print(a)

ans = 0
for i in range(m):
    for j in range(len(a[i])):
        heapq.heappush(d,a[i][j])
    if d != []:
        ans -= heapq.heappop(d)

print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())

a = [[] for i in range(m)]

for _ in range(n):
    b,c = map(int,input().split())
    a[b-1].append(c)

#print(a)

ans = 0
for i in range(m):
    if a[m - 1 - i] != []:
        ans += max(a[m - 1 - i])

print(ans)

Fixed submission:
import heapq

n,m = map(int,input().split())

a = [[] for i in range(100000)]
d = []
heapq.heapify(d)

for _ in range(n):
    b,c = map(int,input().split())
    a[b-1].append(-1 * c)

#print(a)

ans = 0
for i in range(m):
    for j in range(len(a[i])):
        heapq.heappush(d,a[i][j])
    if d != []:
        ans -= heapq.heappop(d)

print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print(max(0,c-(a-b))


Fixed submission:
a,b,c = map(int,input().split())
print(max(0,c-(a-b)))
Buggy python submission (verdict: Runtime Error):
else:
    if b == 1:
        print(a)
    elif b == 3:
        d = '9' * (b // 2)
        '0'.join(d)
        d = int(d + '0')
        print(c - d)
    elif b > 3:
        d = '9' * (b // 2)
        '0'.join(d)
        d = int(d + '1')
        print(c - d)

Fixed submission:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    else:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '0')
        print(c - d)

Buggy python submission (verdict: Runtime Error):
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    else:
        d = '9' * (b // 2)
        '0'.join(d)
        d = int(d + '0')
        print(a-d)

Fixed submission:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    else:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '0')
        print(c - d)

Buggy python submission (verdict: Runtime Error):
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b > 1:
        d = '9' * (b // 2)
    '0'.join(d)
    d = int(d)
    if b > 1:
        print(d + int(a[1:]) + 1)
    else:
        print(int(a))

Fixed submission:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    else:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '0')
        print(c - d)

Buggy python submission (verdict: Runtime Error):
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b > 1:
        d = '9' * (b // 2)
    '0'.join(d)
    d = int(d)
    if b > 1:
        print(d + int(a[1:]) + 1)
    else:
        print(d + int(a) + 1)

Fixed submission:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    else:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '0')
        print(c - d)

Buggy python submission (verdict: Runtime Error):
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b > 1:
        d = '9' * (b // 2)
    '0'.join(d)
    d = int(d)
    print(d + int(a[1:]) + 1)

Fixed submission:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    else:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '0')
        print(c - d)