






from __future__ import annotations

from typing import Any




class  UpperCamelCase_      :



	'''simple docstring'''




	def __init__(       self       ,			a = 6					)       ->    None:
								snake_case_				=							None
								snake_case_				=							None
								self.create_linked_list(a					)




	def 							_UpperCamelCase			(       self       ,			a					)       ->    None:
								snake_case_				=							Node()
								snake_case_				=							current_node
								snake_case_				=							current_node
								snake_case_				=							current_node
								for _ in range(1       ,			a					):
															snake_case_				=							Node()
															snake_case_				=							current_node
															snake_case_				=							previous_node
															snake_case_				=							current_node
								snake_case_				=							self.front
								snake_case_				=							previous_node




	def 							_UpperCamelCase			(       self					)       ->    bool:
								return (
								    self.front == self.rear
								    and self.front is not None
								    and self.front.data is None
								)




	def 							_UpperCamelCase			(       self					)       ->    Any | None:
								self.check_can_perform_operation()
								return self.front.data if self.front else None




	def 							_UpperCamelCase			(       self       ,			a					)       ->    None:
								if self.rear is None:
															return

								self.check_is_full()
								if not self.is_empty():
															snake_case_				=							self.rear.next
								if self.rear:
															snake_case_				=							data




	def 							_UpperCamelCase			(       self					)       ->    Any:
								self.check_can_perform_operation()
								if self.rear is None or self.front is None:
															return None
								if self.front == self.rear:
															snake_case_				=							self.front.data
															snake_case_				=							None
															return data

								snake_case_				=							self.front
								snake_case_				=							old_front.next
								snake_case_				=							old_front.data
								snake_case_				=							None
								return data




	def 							_UpperCamelCase			(       self					)       ->    None:
								if self.is_empty():
															raise Exception('Empty Queue'					)






	def 							_UpperCamelCase			(       self					)       ->    None:
								if self.rear and self.rear.next == self.front:
															raise Exception('Full Queue'					)






class  UpperCamelCase_      :



	'''simple docstring'''




	def __init__(       self					)       ->    None:
								snake_case_				=							None
								snake_case_				=							None
								snake_case_				=							None


if __name__ == "__main__":
	import doctest

	doctest.testmod()













from __future__ import annotations





def 						__UpperCAmelCase			(     a_							,     a_							,     a_							,     a_):  # noqa: E741
							while r - l > 1:
														snake_case_				=							(l + r) // 2
														if v[m] >= key:
																					snake_case_				=							m
														else:
																					snake_case_				=							m  # noqa: E741
							return r





def 						__UpperCAmelCase			(     a_):
							if len(a_) == 0:
														return 0

							snake_case_				=							[0] * len(a_)
							snake_case_				=							1

							snake_case_				=							v[0]

							for i in range(1							,     len(a_)):
														if v[i] < tail[0]:
																					snake_case_				=							v[i]
														elif v[i] > tail[length - 1]:
																					snake_case_				=							v[i]
																					length += 1
														else:
																					snake_case_				=							v[i]

							return length


if __name__ == "__main__":
	import doctest

	doctest.testmod()





