input: Write a function to find and sort all substrings of a given string.
  assert all_substrings('abc') == ['a', 'ab', 'abc', 'b', 'bc', 'c']
  assert all_substrings('abcd') == ['a', 'ab', 'abc', 'abcd', 'b', 'bc', 'bcd', 'c', 'cd', 'd']
  assert all_substrings('a') == ['a']
output: def all_substrings(s):
      substrings = []
      for i in range(len(s)):
          for j in range(i+1, len(s)+1):
              substrings.append(s[i:j])
      return sorted(substrings)