

from functools import lru_cache





@lru_cache
def a(lowercase__						):





	'''simple docstring'''
	if num < 0:
		raise ValueError('Number should not be negative.'						)

	return 1 if num in (0, 1) else num * factorial(num - 1						)


if __name__ == "__main__":
		import doctest

		doctest.testmod()



class SCREAMING_SNAKE_CASE	:






			"""simple docstring"""




			def __init__(     self			,					__UpperCamelCase				):

				"""simple docstring"""


				snake_case_   		=			val
				snake_case_   		=			None
				snake_case_   		=			None







			def       __lowerCAmelCase			(     self			,					__UpperCamelCase				):

				"""simple docstring"""


				if self.val:
					if val < self.val:
						if self.left is None:
							snake_case_   		=			Node(__UpperCamelCase				)
						else:
							self.left.insert(__UpperCamelCase				)
					elif val > self.val:
						if self.right is None:
							snake_case_   		=			Node(__UpperCamelCase				)
						else:
							self.right.insert(__UpperCamelCase				)
				else:
					snake_case_   		=			val







def a(lowercase__      ,			lowercase__						):





	'''simple docstring'''
	# Recursive traversal
	if root:
		inorder(root.left      ,			lowercase__						)
		res.append(root.val						)
		inorder(root.right      ,			lowercase__						)





def a(lowercase__						):





	'''simple docstring'''
	# Build BST
	if len(lowercase__						) == 0:
		return arr
	snake_case_   		=			Node(arr[0]						)
	for i in range(1      ,			len(lowercase__						)						):
		root.insert(arr[i]						)
	# Traverse BST in order.
	snake_case_   		=			[]
	inorder(lowercase__      ,			lowercase__						)
	return res


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