"""simple docstring"""



from __future__ import annotations

from collections import deque
from collections.abc import Sequence
from dataclasses import dataclass
from typing import Any




@dataclass
class 				snake_case__     :
 _snake_case   :			int
 _snake_case   :			Node | None           =		None
 _snake_case   :			Node | None           =		None



def 					_lowerCamelCase(					):
       __a     				=  Node(1							)
       __a     				=  Node(2							)
       __a     				=  Node(3							)
       __a     				=  Node(4							)
       __a     				=  Node(5							)
       return tree



def 					_lowerCamelCase(					a							):
       return [root.data, *preorder(root.left							), *preorder(root.right							)] if root else []



def 					_lowerCamelCase(					a							):
       return postorder(root.left							) + postorder(root.right							) + [root.data] if root else []



def 					_lowerCamelCase(					a							):
       return [*inorder(root.left							), root.data, *inorder(root.right							)] if root else []



def 					_lowerCamelCase(					a							):
       return (max(height(root.left							) ,  height(root.right							)							) + 1) if root else 0



def 					_lowerCamelCase(					a							):
       __a     				=  []

       if root is None:
              return output

       __a     				=  deque([root]							)

       while process_queue:
              __a     				=  process_queue.popleft()
              output.append(node.data							)

              if node.left:
                     process_queue.append(node.left							)
              if node.right:
                     process_queue.append(node.right							)
       return output



def 					_lowerCamelCase(					a ,  a							):
       __a     				=  []

       def populate_output(a ,  a							) -> None:
              if not root:
                     return
              if level == 1:
                     output.append(root.data							)
              elif level > 1:
                     populate_output(root.left ,  level - 1							)
                     populate_output(root.right ,  level - 1							)

       populate_output(a ,  a							)
       return output



def 					_lowerCamelCase(					a ,  a							):
       __a     				=  []

       def populate_output(a ,  a							) -> None:
              if root is None:
                     return
              if level == 1:
                     output.append(root.data							)
              elif level > 1:
                     populate_output(root.right ,  level - 1							)
                     populate_output(root.left ,  level - 1							)

       populate_output(a ,  a							)
       return output



def 					_lowerCamelCase(					a							):
       if root is None:
              return []

       __a     				=  []

       __a     				=  0
       __a     				=  height(a							)

       for h in range(1 ,  height_tree + 1							):
              if not flag:
                     output.append(get_nodes_from_left_to_right(a ,  a							)							)
                     __a     				=  1
              else:
                     output.append(get_nodes_from_right_to_left(a ,  a							)							)
                     __a     				=  0

       return output



def 					_lowerCamelCase(					):  # Main function for testing.
       __a     				=  make_tree()
       print(F"In-order Traversal: {inorder(a							)}"							)
       print(F"Pre-order Traversal: {preorder(a							)}"							)
       print(F"Post-order Traversal: {postorder(a							)}" ,  "\n"							)

       print(F"Height of Tree: {height(a							)}" ,  "\n"							)

       print("Complete Level Order Traversal: "							)
       print(level_order(a							) ,  "\n"							)

       print("Level-wise order Traversal: "							)

       for level in range(1 ,  height(a							) + 1							):
              print(F"Level {level}:" ,  get_nodes_from_left_to_right(a ,  level=a							)							)

       print("\nZigZag order Traversal: "							)
       print(zigzag(a							)							)


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   main()

"""simple docstring"""



def 					_lowerCamelCase(					a							):
       __a     				=  len(a							)
       for i in range(1 ,  a							):
              __a     				=  collection[i]
              __a     				=  0
              __a     				=  i - 1

              while low <= high:
                     __a     				=  (low + high) // 2
                     if val < collection[mid]:
                            __a     				=  mid - 1
                     else:
                            __a     				=  mid + 1
              for j in range(a ,  a ,  -1							):
                     __a     				=  collection[j - 1]
              __a     				=  val
       return collection


if __name__ == "__main__":
   SCREAMING_SNAKE_CASE__:str			=	input("""Enter numbers separated by a comma:\n""").strip()
   SCREAMING_SNAKE_CASE__:Any			=	[int(item) for item in user_input.split(""",""")]
   print(binary_insertion_sort(unsorted))
