




'''simple docstring'''






from __future__ import annotations

import matplotlib.pyplot as plt  # type: ignore
import numpy

# initial triangle of Koch snowflake
A_			      =		numpy.array([0, 0])
A_			      =		numpy.array([0.5, 0.8_66_02_54])
A_			      =		numpy.array([1, 0])
A_			      =		[VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)    ->   list[numpy.ndarray]:
      snake_case__       :   Union[str, Any]	      =    initial_vectors
      for _ in range(__SCREAMING_SNAKE_CASE		):
            snake_case__       :   List[str]	      =    iteration_step(__SCREAMING_SNAKE_CASE		)
      return vectors






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   list[numpy.ndarray]:
      snake_case__       :   Tuple	      =    []
      for i, start_vector in enumerate(vectors[:-1]		):
            snake_case__       :   Any	      =    vectors[i + 1]
            new_vectors.append(__SCREAMING_SNAKE_CASE		)
            snake_case__       :   Optional[int]	      =    end_vector - start_vector
            new_vectors.append(start_vector + difference_vector / 3		)
            new_vectors.append(
                start_vector + difference_vector / 3 + rotate(difference_vector / 3				,      60		)		)
            new_vectors.append(start_vector + difference_vector * 2 / 3		)
      new_vectors.append(vectors[-1]		)
      return new_vectors






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)    ->   numpy.ndarray:
      snake_case__       :   List[str]	      =    numpy.radians(__SCREAMING_SNAKE_CASE		)
      snake_case__      ,							snake_case__       :   List[str]	      =    numpy.cos(__SCREAMING_SNAKE_CASE		), numpy.sin(__SCREAMING_SNAKE_CASE		)
      snake_case__       :   Dict	      =    numpy.array(((c, -s), (s, c))		)
      return numpy.dot(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   None:
      snake_case__       :   Tuple	      =    plt.gca()
      axes.set_aspect('equal'		)

      # matplotlib.pyplot.plot takes a list of all x-coordinates and a list of all
      # y-coordinates as inputs, which are constructed from the vector-list using
      # zip()
      snake_case__      ,							snake_case__       :   int	      =    zip(*__SCREAMING_SNAKE_CASE		)
      plt.plot(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)
      plt.show()


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      A_			      =		iterate(INITIAL_VECTORS, 5)
      plot(processed_vectors)






'''simple docstring'''






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   str:
      snake_case__      ,							snake_case__       :   Optional[int]	      =    [], []
      while len(__SCREAMING_SNAKE_CASE		) > 1:
            snake_case__      ,							snake_case__       :   Tuple	      =    min(__SCREAMING_SNAKE_CASE		), max(__SCREAMING_SNAKE_CASE		)
            start.append(__SCREAMING_SNAKE_CASE		)
            end.append(__SCREAMING_SNAKE_CASE		)
            collection.remove(__SCREAMING_SNAKE_CASE		)
            collection.remove(__SCREAMING_SNAKE_CASE		)
      end.reverse()
      return start + collection + end


if __name__ == "__main__":
      A_			      =		input("Enter numbers separated by a comma:\n").strip()
      A_			      =		[int(item) for item in user_input.split(",")]
      print(*merge_sort(unsorted), sep=",")
