input: 
  def sort_substrings(string: str) -> List[str]:
      """
      Generate a Python program which takes a string as input and prints all of 
      its substrings in order from longest to shortest length.
      
      >>> sort_substrings("abcd")
      ['abcd', 'abc', 'abd', 'bcd', 'ab', 'acd', 'bcd', 'bc', 'ac', 'bd', 'cd', 'a', 'b', 'c', 'd']
      >>> sort_substrings("xyz")
      ['xyz', 'xy', 'xz', 'yz', 'x', 'y', 'z']
      """
      result = []
      n = len(string)
      for l in range(n, 0, -1):
          for i in range(n-l + 1):
              result.append(string[i:i+l])
      return result
  
  string = input("Enter the string: ")
  print("All substrings in order from longest to shortest:")
  print(sort_substrings(string))
  
output:     
      result = []
      n = len(string)
      for l in range(n, 0, -1):
          for i in range(n-l + 1):
              result.append(string[i:i+l])
      return result
  