code: def search(T, dist, w, i=0):
      
      if i == len(w):
          if T is not None and T.isWord and dist == 0:
              return ""
          else:
              return None
      if T is None:
          return None
      f = search(T.s[w[i]], dist, w, i + 1)       # matching
      if f is not None:
          return w[i] + f
      if dist == 0:
          return None
      for c in ascii_letters:
          f = search(T.s[c], dist - 1, w, i)      # insertion
          if f is not None:
              return c + f
          f = search(T.s[c], dist - 1, w, i + 1)  # substitution
          if f is not None:
              return c + f
      return search(T, dist - 1, w, i + 1)
docs: Searches for w[i:] in trie T with distance at most dist