




"""simple docstring"""







__A   :  dict[tuple[int, int, int], int]					=      {}

def 						snake_case__       (					_lowerCamelCase,  _lowerCamelCase,  _lowerCamelCase				)			->int:






		"""simple docstring"""


		if late == 3 or absent == 2:
				return 0

		# if we have no days left, and have not failed any other rules,
		# we have a prize string
		if days == 0:
				return 1

		# No easy solution, so now we need to do the recursive calculation

		# First, check if the combination is already in the cache, and
		# if yes, return the stored value from there since we already
		# know the number of possible prize strings from this point on
		__lowercase				:		str												=				(days, absent, late)
		if key in cache:
				return cache[key]

		# now we calculate the three possible ways that can unfold from
		# this point on, depending on our attendance today

		# 1) if we are late (but not absent), the "absent" counter stays as
		# it is, but the "late" counter increases by one
		__lowercase				:		List[Any]												=				_calculate(days - 1,  _lowerCamelCase,  late + 1				)

		# 2) if we are absent, the "absent" counter increases by 1, and the
		# "late" counter resets to 0
		__lowercase				:		Dict												=				_calculate(days - 1,  absent + 1,  0				)

		# 3) if we are on time, this resets the "late" counter and keeps the
		# absent counter
		__lowercase				:		int												=				_calculate(days - 1,  _lowerCamelCase,  0				)

		__lowercase				:		str												=				state_late + state_absent + state_ontime

		__lowercase				:		List[str]												=				prizestrings
		return prizestrings

def 						snake_case__       (					_lowerCamelCase = 30				)			->int:






		"""simple docstring"""


		return _calculate(_lowerCamelCase,  absent=0,  late=0				)


if __name__ == "__main__":
						print(solution())










"""simple docstring"""







class       lowerCAmelCase__       :


				"""simple docstring"""





				def __init__(     self					:	int    ,   lowercase__					:	List[Any]						):
						__lowercase				:		Tuple												=				val
						__lowercase				:		Optional[Any]												=				None
						__lowercase				:		Tuple												=				None



				def       snake_case    (     self					:	Optional[Any]    ,   lowercase__					:	List[str]						):
						if self.val:
								if val < self.val:
										if self.left is None:
												__lowercase				:		Tuple												=				Node(lowercase__						)
										else:
												self.left.insert(lowercase__						)
								elif val > self.val:
										if self.right is None:
												__lowercase				:		Any												=				Node(lowercase__						)
										else:
												self.right.insert(lowercase__						)
						else:
								__lowercase				:		Optional[Any]												=				val





def 						snake_case__       (					_lowerCamelCase,  _lowerCamelCase				)			->Any:






		"""simple docstring"""


		if root:
				inorder(root.left,  _lowerCamelCase				)
				res.append(root.val				)
				inorder(root.right,  _lowerCamelCase				)

def 						snake_case__       (					_lowerCamelCase				)			->Optional[Any]:






		"""simple docstring"""


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


if __name__ == "__main__":
						print(tree_sort([1_0, 1, 3, 2, 9, 1_4, 1_3]))
