





"""simple docstring"""




class 			__UpperCamelCase							(		a__		):
							pass


class 			__UpperCamelCase							(		a__		):
							pass


class 			__UpperCamelCase							:






							def __init__(  self )      ->					int:
								a :						List[Any]      =							[
								    [],
								    [],
								    [],
								]






							def        __a  (  self ,   lowerCAmelCase__ ,   lowerCAmelCase__ )      ->					None:
								try:
									if len(self.queues[priority] ) >= 100:
										raise OverflowError("Maximum queue size is 100" )
									self.queues[priority].append(lowerCAmelCase__ )
								except IndexError:
									raise ValueError("Valid priorities are 0, 1, and 2" )






							def        __a  (  self )      ->					int:
								for queue in self.queues:
									if queue:
										return queue.pop(0 )
								raise UnderFlowError("All queues are empty" )






							def __str__(  self )      ->					str:
								return "\n".join(f"""Priority {i}: {q}""" for i, q in enumerate(self.queues ) )


class 			__UpperCamelCase							:






							def __init__(  self )      ->					Optional[int]:
								a :						Optional[int]      =							[]






							def        __a  (  self ,   lowerCAmelCase__ )      ->					None:
								if len(self.queue ) == 100:
									raise OverFlowError("Maximum queue size is 100" )
								self.queue.append(lowerCAmelCase__ )






							def        __a  (  self )      ->					int:
								if not self.queue:
									raise UnderFlowError("The queue is empty" )
								else:
									a :						Union[str, Any]      =							min(self.queue )
									self.queue.remove(lowerCAmelCase__ )
									return data






							def __str__(  self )      ->					str:
								return str(self.queue )






def  _SCREAMING_SNAKE_CASE						(      )					->str:






	'''simple docstring'''






	a :						Union[str, Any]      =							FixedPriorityQueue()
	fpq.enqueue(0       ,			10   )
	fpq.enqueue(1       ,			70   )
	fpq.enqueue(0       ,			100   )
	fpq.enqueue(2       ,			1   )
	fpq.enqueue(2       ,			5   )
	fpq.enqueue(1       ,			7   )
	fpq.enqueue(2       ,			4   )
	fpq.enqueue(1       ,			64   )
	fpq.enqueue(0       ,			128   )
	print(_lowercase   )
	print(fpq.dequeue()   )
	print(fpq.dequeue()   )
	print(fpq.dequeue()   )
	print(fpq.dequeue()   )
	print(fpq.dequeue()   )
	print(_lowercase   )
	print(fpq.dequeue()   )
	print(fpq.dequeue()   )
	print(fpq.dequeue()   )
	print(fpq.dequeue()   )
	print(fpq.dequeue()   )






def  _SCREAMING_SNAKE_CASE						(      )					->Any:






	'''simple docstring'''






	a :						Union[str, Any]      =							ElementPriorityQueue()
	epq.enqueue(10   )
	epq.enqueue(70   )
	epq.enqueue(100   )
	epq.enqueue(1   )
	epq.enqueue(5   )
	epq.enqueue(7   )
	epq.enqueue(4   )
	epq.enqueue(64   )
	epq.enqueue(128   )
	print(_lowercase   )
	print(epq.dequeue()   )
	print(epq.dequeue()   )
	print(epq.dequeue()   )
	print(epq.dequeue()   )
	print(epq.dequeue()   )
	print(_lowercase   )
	print(epq.dequeue()   )
	print(epq.dequeue()   )
	print(epq.dequeue()   )
	print(epq.dequeue()   )
	print(epq.dequeue()   )


if __name__ == "__main__":
		fixed_priority_queue()
		element_priority_queue()









"""simple docstring"""




def  _SCREAMING_SNAKE_CASE						(      _lowercase		:       list[int]   )					->float:






	'''simple docstring'''






	if not nums:  # Makes sure that the list is not empty
		raise ValueError("List is empty"   )

	a :						Dict      =							sum(_lowercase   ) / len(_lowercase   )  # Calculate the average
	return sum(abs(x - average   ) for x in nums   ) / len(_lowercase   )


if __name__ == "__main__":
		import doctest

		doctest.testmod()


