

"""simple docstring"""






from typing import Any






class     _UpperCAmelCase			:
			def __init__(		self     )    ->    List[str]:






				'''simple docstring'''







				_UpperCAmelCase    :							Any									=					[]
				_UpperCAmelCase    :							int									=					0
			def __str__(		self     )    ->    int:






				'''simple docstring'''







				_UpperCAmelCase    :							Any									=					"""<""" + str(self.stack     )[1:-1] + """>"""
				return printed
			def 							__snake_case (		self      ,		_A     )    ->    None:






				'''simple docstring'''







				self.stack.append(_A     )
				_UpperCAmelCase    :							Tuple									=					self.length + 1
			def 							__snake_case (		self     )    ->    Any:






				'''simple docstring'''







				self.rotate(1     )
				_UpperCAmelCase    :							Optional[int]									=					self.stack[self.length - 1]
				_UpperCAmelCase    :							int									=					self.stack[:-1]
				self.rotate(self.length - 1     )
				_UpperCAmelCase    :							Tuple									=					self.length - 1
				return dequeued
			def 							__snake_case (		self      ,		_A     )    ->    None:






				'''simple docstring'''







				for _ in range(_A     ):
					_UpperCAmelCase    :							Optional[Any]									=					self.stack[0]
					_UpperCAmelCase    :							Dict									=					self.stack[1:]
					self.put(_A     )
					_UpperCAmelCase    :							Dict									=					self.length - 1
			def 							__snake_case (		self     )    ->    Any:






				'''simple docstring'''







				_UpperCAmelCase    :							int									=					self.get()
				self.put(_A     )
				self.rotate(self.length - 1     )
				return front
			def 							__snake_case (		self     )    ->    int:






				'''simple docstring'''







				return self.length








"""simple docstring"""






def       UpperCamelCase					(			_lowerCAmelCase     :						int )				->			str:
	_UpperCAmelCase    :							Any									=					1
	_UpperCAmelCase    :							List[str]									=					0
	_UpperCAmelCase    :							str									=					1
	_UpperCAmelCase    :							Union[str, Any]									=					1
	_UpperCAmelCase    :							int									=					3
	_UpperCAmelCase    :							int									=					3
	_UpperCAmelCase    :							List[str]									=					limit
	_UpperCAmelCase    :							Optional[Any]									=					0

	_UpperCAmelCase    :							Any									=					""""""
	while counter != decimal + 1:
		if 4 * q + r - t < n * t:
			result += str(_lowerCAmelCase )
			if counter == 0:
				result += "."

			if decimal == counter:
				break

			counter += 1
			_UpperCAmelCase    :							str									=					10 * (r - n * t)
			_UpperCAmelCase    :							List[Any]									=					((10 * (3 * q + r)) // t) - 10 * n
			q *= 10
			_UpperCAmelCase    :							int									=					nr
		else:
			_UpperCAmelCase    :							Any									=					(2 * q + r) * l
			_UpperCAmelCase    :							str									=					(q * (7 * k) + 2 + (r * l)) // (t * l)
			q *= k
			t *= l
			l += 2
			k += 1
			_UpperCAmelCase    :							List[Any]									=					nn
			_UpperCAmelCase    :							Optional[int]									=					nr
	return result
def       UpperCamelCase					(			)				->			None:
	print(f'''{calculate_pi(50 ) = }''' )
	import doctest

	doctest.testmod()


if __name__ == "__main__":
						main()





