'''simple docstring'''

class   SCREAMING_SNAKE_CASE			(						__lowercase):







		"""simple docstring"""
		pass

class   SCREAMING_SNAKE_CASE			(						__lowercase):







		"""simple docstring"""
		pass

class   SCREAMING_SNAKE_CASE			:







		"""simple docstring"""






		def __init__(   self				) ->     Optional[Any]:
								_lowerCAmelCase										=[
								    [],
								    [],
								    [],
								]






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






		def 		UpperCamelCase__       (   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   SCREAMING_SNAKE_CASE			:







		"""simple docstring"""






		def __init__(   self				) ->     Dict:
								_lowerCAmelCase										=[]






		def 		UpperCamelCase__       (   self		,						__A				) ->     None:
								if len(self.queue				) == 100:
														raise OverFlowError('Maximum queue size is 100'				)
								self.queue.append(__A				)






		def 		UpperCamelCase__       (   self				) ->     int:
								if not self.queue:
														raise UnderFlowError('The queue is empty'				)
								else:
														_lowerCAmelCase										=min(self.queue				)
														self.queue.remove(__A				)
														return data






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



def 							UpperCamelCase__			(			):


						'''simple docstring'''






						_lowerCAmelCase										=FixedPriorityQueue()
						fpq.enqueue(0			,      1_0      )
						fpq.enqueue(1			,      7_0      )
						fpq.enqueue(0			,      1_0_0      )
						fpq.enqueue(2			,      1      )
						fpq.enqueue(2			,      5      )
						fpq.enqueue(1			,      7      )
						fpq.enqueue(2			,      4      )
						fpq.enqueue(1			,      6_4      )
						fpq.enqueue(0			,      1_2_8      )
						print(a__      )
						print(fpq.dequeue()      )
						print(fpq.dequeue()      )
						print(fpq.dequeue()      )
						print(fpq.dequeue()      )
						print(fpq.dequeue()      )
						print(a__      )
						print(fpq.dequeue()      )
						print(fpq.dequeue()      )
						print(fpq.dequeue()      )
						print(fpq.dequeue()      )
						print(fpq.dequeue()      )



def 							UpperCamelCase__			(			):


						'''simple docstring'''






						_lowerCAmelCase										=ElementPriorityQueue()
						epq.enqueue(1_0      )
						epq.enqueue(7_0      )
						epq.enqueue(1_0_0      )
						epq.enqueue(1      )
						epq.enqueue(5      )
						epq.enqueue(7      )
						epq.enqueue(4      )
						epq.enqueue(6_4      )
						epq.enqueue(1_2_8      )
						print(a__      )
						print(epq.dequeue()      )
						print(epq.dequeue()      )
						print(epq.dequeue()      )
						print(epq.dequeue()      )
						print(epq.dequeue()      )
						print(a__      )
						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

lowercase_     		= 10



def 							UpperCamelCase__			(			a__      ):


						'''simple docstring'''






						_lowerCAmelCase										=1
						_lowerCAmelCase										=max(a__      )
						while placement <= max_digit:
												# declare and initialize empty buckets
												_lowerCAmelCase										=[[] for _ in range(a__      )]
												# split list_of_ints between the buckets
												for i in list_of_ints:
																		_lowerCAmelCase										=int((i / placement) % RADIX      )
																		buckets[tmp].append(a__      )
												# put each buckets' contents into list_of_ints
												_lowerCAmelCase										=0
												for b in range(a__      ):
																		for i in buckets[b]:
																								_lowerCAmelCase										=i
																								a += 1
        # move to next
												placement *= RADIX
						return list_of_ints


if __name__ == "__main__":
							import doctest

							doctest.testmod()





