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

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)

Fixed submission:
N = int(input())

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  if m < 10:
    print(1000-m)
  elif m < 100:
    print(1000-(int(str(m)[-2])*10) + (int(str(m)[-1])))
  else:
    print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)

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

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000:
  print(0)
elif 1000 < N:
  m = n * (-1)
  print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)





Fixed submission:
N = int(input())

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  if m < 10:
    print(1000-m)
  elif m < 100:
    print(1000-(int(str(m)[-2])*10) + (int(str(m)[-1])))
  else:
    print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)

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

n = 1000 - N
if 1000 < N:
  m = n * (-1)
  print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)





Fixed submission:
N = int(input())

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  if m < 10:
    print(1000-m)
  elif m < 100:
    print(1000-(int(str(m)[-2])*10) + (int(str(m)[-1])))
  else:
    print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)

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

n = 1000 - N
if 1000 < N:
  m = n * (-1)
else:
  m = n

print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))




Fixed submission:
N = int(input())

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  if m < 10:
    print(1000-m)
  elif m < 100:
    print(1000-(int(str(m)[-2])*10) + (int(str(m)[-1])))
  else:
    print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)

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

n = 1000 - N
if 1000 < N:
  m = n * (-1)
else:
  m = n

print((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1])))






Fixed submission:
N = int(input())

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  if m < 10:
    print(1000-m)
  elif m < 100:
    print(1000-(int(str(m)[-2])*10) + (int(str(m)[-1])))
  else:
    print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)

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

n = 1000 - N
if 1000 < N:
  m = n * (-1)
else:
  m = n

print(int(str(m)[-3])*100)

Fixed submission:
N = int(input())

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  if m < 10:
    print(1000-m)
  elif m < 100:
    print(1000-(int(str(m)[-2])*10) + (int(str(m)[-1])))
  else:
    print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)

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

n = 1000 - N
if 1000 < N:
  m = n * (-1)
else:
  pass

print(int(str(m)[-3])*100)




Fixed submission:
N = int(input())

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  if m < 10:
    print(1000-m)
  elif m < 100:
    print(1000-(int(str(m)[-2])*10) + (int(str(m)[-1])))
  else:
    print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)