


"""simple docstring"""




class 					__lowerCAmelCase					(   lowercase_       ):


		'''simple docstring'''



		pass







class 					__lowerCAmelCase					(   lowercase_       ):


		'''simple docstring'''



		pass







class 					__lowerCAmelCase					:


		'''simple docstring'''



		def __init__(  self      ):
				__a           =			[
				    [],
				    [],
				    [],
				]

		def 			__UpperCAmelCase       (  self							, _a							, _a      ):


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

		def 			__UpperCAmelCase       (  self      ):


				for queue in self.queues:
						if queue:
								return queue.pop(0      )
				raise UnderFlowError('''All queues are empty'''      )





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







class 					__lowerCAmelCase					:


		'''simple docstring'''



		def __init__(  self      ):
				__a           =			[]

		def 			__UpperCAmelCase       (  self							, _a      ):


				if len(self.queue      ) == 100:
						raise OverFlowError('''Maximum queue size is 100'''      )
				self.queue.append(__UpperCamelCase      )

		def 			__UpperCAmelCase       (  self      ):


				if not self.queue:
						raise UnderFlowError('''The queue is empty'''      )
				else:
						__a           =			min(self.queue      )
						self.queue.remove(__UpperCamelCase      )
						return data





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







def        lowercase							(		) ->      Union[str, Any]:
		__a           =			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(__SCREAMING_SNAKE_CASE			)
		print(fpq.dequeue()			)
		print(fpq.dequeue()			)
		print(fpq.dequeue()			)
		print(fpq.dequeue()			)
		print(fpq.dequeue()			)
		print(__SCREAMING_SNAKE_CASE			)
		print(fpq.dequeue()			)
		print(fpq.dequeue()			)
		print(fpq.dequeue()			)
		print(fpq.dequeue()			)
		print(fpq.dequeue()			)

def        lowercase							(		) ->      Dict:
		__a           =			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(__SCREAMING_SNAKE_CASE			)
		print(epq.dequeue()			)
		print(epq.dequeue()			)
		print(epq.dequeue()			)
		print(epq.dequeue()			)
		print(epq.dequeue()			)
		print(__SCREAMING_SNAKE_CASE			)
		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"""







from __future__ import annotations



def 			lowercase__(       __SCREAMING_SNAKE_CASE							:     list      ):
     if not nums:
          raise ValueError('List is empty'      )
     return sum(__SCREAMING_SNAKE_CASE      ) / len(__SCREAMING_SNAKE_CASE      )


if __name__ == "__main__":
       import doctest

       doctest.testmod()

