






from __future__ import annotations

import math
import random


def __A					(   __lowerCAmelCase				,	__lowerCAmelCase				,	__lowerCAmelCase			)->						list[int]:





						"""simple docstring"""



						_UpperCAmelCase             =    d * e - 1
						_UpperCAmelCase             =    0
						_UpperCAmelCase             =    0
						while p == 0:
												_UpperCAmelCase             =    random.randint(2				,	n - 1			)
												_UpperCAmelCase             =    k
												while True:
																		if t % 2 == 0:
																								_UpperCAmelCase             =    t // 2
																								_UpperCAmelCase             =    (g**t) % n
																								_UpperCAmelCase             =    math.gcd(x - 1				,	__lowerCAmelCase			)
																								if x > 1 and y > 1:
																														_UpperCAmelCase             =    y
																														_UpperCAmelCase             =    n // y
																														break  # find the correct factors
																		else:
																								break  # t is not divisible by 2, break and choose another g
						return sorted([p, q]			)


if __name__ == "__main__":
		import doctest

		doctest.testmod()








from typing import Any





class __lowerCamelCase				:





	"""simple docstring"""






	def __init__(							self					):
							"""simple docstring"""







							_UpperCAmelCase             =    []
							_UpperCAmelCase             =    0

	def __str__(							self					):
							"""simple docstring"""







							_UpperCAmelCase             =    '<' + str(self.stack					)[1:-1] + '>'
							return printed

	def  UpperCamelCase					(							self ,					UpperCAmelCase					):
							"""simple docstring"""







							self.stack.append(UpperCAmelCase					)
							_UpperCAmelCase             =    self.length + 1

	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							self.rotate(1					)
							_UpperCAmelCase             =    self.stack[self.length - 1]
							_UpperCAmelCase             =    self.stack[:-1]
							self.rotate(self.length - 1					)
							_UpperCAmelCase             =    self.length - 1
							return dequeued

	def  UpperCamelCase					(							self ,					UpperCAmelCase					):
							"""simple docstring"""







							for _ in range(UpperCAmelCase					):
													_UpperCAmelCase             =    self.stack[0]
													_UpperCAmelCase             =    self.stack[1:]
													self.put(UpperCAmelCase					)
													_UpperCAmelCase             =    self.length - 1

	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							_UpperCAmelCase             =    self.get()
							self.put(UpperCAmelCase					)
							self.rotate(self.length - 1					)
							return front

	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							return self.length
