output_description: Print the minimum possible difference between X and 753.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: import sys, re
  from collections import deque, defaultdict, Counter
  from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
  from itertools import accumulate, permutations, combinations, product, groupby
  from operator import itemgetter, mul
  from copy import deepcopy
  from string import ascii_lowercase, ascii_uppercase, digits
  from bisect import bisect, bisect_left
  from fractions import gcd
  from heapq import heappush, heappop
  from functools import reduce
  
  
  def input():
      return sys.stdin.readline().strip()
  
  
  def INT():
      return int(input())
  
  
  def MAP():
      return map(int, input().split())
  
  
  def LIST():
      return list(map(int, input().split()))
  
  
  def ZIP(n):
      return zip(*(MAP() for _ in range(n)))
  
  
  sys.setrecursionlimit(10**9)
  INF = float("inf")
  mod = 10**9 + 7
  
  S = input()
  a = abs(int(S[0]) * 100 + int(S[1]) * 10 + int(S[2]) - 753)
  
  for i in range(1, len(S) - 2):
      b = abs(int(S[i]) * 100 + int(S[i + 1]) * 10 + int(S[i + 2]) - 753)
      a = min(a, b)
  
  print(a)
  
problem_description: Statement
  
  There is a string S consisting of digits `1`, `2`, ..., `9`. Lunlun, the
  Dachshund, will take out three consecutive digits from S, treat them as a
  single integer X and bring it to her master. (She cannot rearrange the
  digits.)
  
  The master's favorite number is 753. The closer to this number, the better.
  What is the minimum possible (absolute) difference between X and 753?
samples: [{"input": "1234567876", "output": "34\n    \n\nTaking out the seventh to ninth characters results in X = 787, and the\ndifference between this and 753 is 787 - 753 = 34. The difference cannot be\nmade smaller, no matter where X is taken from.\n\nNote that the digits cannot be rearranged. For example, taking out `567` and\nrearranging it to `765` is not allowed.\n\nWe cannot take out three digits that are not consecutive from S, either. For\nexample, taking out the seventh digit `7`, the ninth digit `7` and the tenth\ndigit `6` to obtain `776` is not allowed.\n\n* * *"}, {"input": "35753", "output": "0\n    \n\nIf `753` itself can be taken out, the answer is 0.\n\n* * *"}, {"input": "1111111111", "output": "642\n    \n\nNo matter where X is taken from, X = 111, with the difference 753 - 111 = 642."}]