





'''simple docstring'''






import math
def   UpperCamelCase__ (						lowerCAmelCase    ):





      """simple docstring"""


      if not isinstance(lowerCAmelCase				,      lowerCAmelCase    ):
            _lowerCAmelCase					=				f"Input value of [number={number}] must be an integer"
            raise TypeError(lowerCAmelCase    )

      if number < 1:
            _lowerCAmelCase					=				f"Input value of [number={number}] must be > 0"
            raise ValueError(lowerCAmelCase    )
      elif number == 1:
            return 3
      elif number == 2:
            return 5
      else:
            _lowerCAmelCase					=				int(math.log(number // 3				,      2    )    ) + 2

            _lowerCAmelCase					=				[3, 5]
            _lowerCAmelCase					=				2
            _lowerCAmelCase					=				3
            for block in range(1				,      lowerCAmelCase    ):
                  for _ in range(lowerCAmelCase    ):
                        proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]    )
                        proth_index += 1
                  increment *= 2

      return proth_list[number - 1]


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      for number in range(11):
            A__							:  List[Any]    =0
            try:
                  A__							:  Optional[Any]    =proth(number)
            except ValueError:
                  print(F"""ValueError: there is no {number}th Proth number""")
                  continue

            print(F"""The {number}th Proth number: {value}""")













'''simple docstring'''






class 					UpperCAmelCase	:




      def __init__(     self     :					List[str]     ,     __snake_case     :					str    )							-> Union[str, Any]:
            _lowerCAmelCase					=				val
            _lowerCAmelCase					=				None
            _lowerCAmelCase					=				None




      def 							lowercase__       (     self     :					Optional[Any]     ,     __snake_case     :					int    )							-> Optional[int]:
            if self.val:
                  if val < self.val:
                        if self.left is None:
                              _lowerCAmelCase					=				Node(__snake_case    )
                        else:
                              self.left.insert(__snake_case    )
                  elif val > self.val:
                        if self.right is None:
                              _lowerCAmelCase					=				Node(__snake_case    )
                        else:
                              self.right.insert(__snake_case    )
            else:
                  _lowerCAmelCase					=				val




def   UpperCamelCase__ (						lowerCAmelCase				,      lowerCAmelCase    ):





      """simple docstring"""


      if root:
            inorder(root.left				,      lowerCAmelCase    )
            res.append(root.val    )
            inorder(root.right				,      lowerCAmelCase    )
def   UpperCamelCase__ (						lowerCAmelCase    ):





      """simple docstring"""


      if len(lowerCAmelCase    ) == 0:
            return arr
      _lowerCAmelCase					=				Node(arr[0]    )
      for i in range(1				,      len(lowerCAmelCase    )    ):
            root.insert(arr[i]    )
      # Traverse BST in order.
      _lowerCAmelCase					=				[]
      inorder(lowerCAmelCase				,      lowerCAmelCase    )
      return res


if __name__ == "__main__":
      print(tree_sort([10, 1, 3, 2, 9, 14, 13]))






