input: def rearrange_divisible_by_three(lst: list):
      """This function accepts a list lst and returns a new list where elements at indices divisible by three are sorted, while other elements remain unchanged.
      >>> rearrange_divisible_by_three([1, 2, 3])
      [1, 2, 3]
      >>> rearrange_divisible_by_three([5, 6, 3, 4, 8, 9, 2])
      [2, 6, 3, 4, 8, 9, 5]
      """
output:     
      divisible_by_three_indices = [i for i in range(len(lst)) if i % 3 == 0]
      divisible_by_three_elements = [lst[i] for i in divisible_by_three_indices]
      
      sorted_divisible_by_three_elements = sorted(divisible_by_three_elements)
      
      for i, idx in enumerate(divisible_by_three_indices):
          lst[idx] = sorted_divisible_by_three_elements[i]
      
      return lst
  