"""simple docstring"""





import enum
import shutil
import sys


lowerCAmelCase_ ,					lowerCAmelCase_     =	shutil.get_terminal_size()

lowerCAmelCase_     =	{'''UP''': '''A''', '''DOWN''': '''B''', '''RIGHT''': '''C''', '''LEFT''': '''D'''}




class  _snake_case		(    enum.Enum ):







				"""simple docstring"""






				a			=						0
				a			=						1



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE=""  )->    Any:
							sys.stdout.write(str(__SCREAMING_SNAKE_CASE  ) + end  )
							sys.stdout.flush()



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE=""  )->    str:
							forceWrite(F"""\u001b[{color}m{content}\u001b[0m"""     ,	__SCREAMING_SNAKE_CASE  )



def      lowerCamelCase_()->    Optional[Any]:
							forceWrite("""\r"""  )



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE  )->    Any:
							forceWrite(F"""\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}"""  )



def      lowerCamelCase_()->    Dict:
							forceWrite(""" """ * TERMINAL_WIDTH  )
							reset_cursor()



def      lowerCamelCase_()->    Any:
							reset_cursor()
							forceWrite("""-""" * TERMINAL_WIDTH  )



"""simple docstring"""





from decimal import Decimal, getcontext
from math import ceil, factorial



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE  )->    str:

							if not isinstance(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE  ):
														raise TypeError("""Undefined for non-integers"""  )
							elif precision < 1:
														raise ValueError("""Undefined for non-natural numbers"""  )

							_SCREAMING_SNAKE_CASE		:						int			  =    precision
							_SCREAMING_SNAKE_CASE		:						Dict			  =    ceil(precision / 14  )
							_SCREAMING_SNAKE_CASE		:						int			  =    426_880 * Decimal(10_005  ).sqrt()
							_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    1
							_SCREAMING_SNAKE_CASE		:						str			  =    13_591_409
							_SCREAMING_SNAKE_CASE		:						Tuple			  =    Decimal(__SCREAMING_SNAKE_CASE  )
							for k in range(1     ,	__SCREAMING_SNAKE_CASE  ):
														_SCREAMING_SNAKE_CASE		:						Tuple			  =    factorial(6 * k  ) // (factorial(3 * k  ) * factorial(__SCREAMING_SNAKE_CASE  ) ** 3)
														linear_term += 545_140_134
														exponential_term *= -262_537_412_640_768_000
														partial_sum += Decimal(multinomial_term * linear_term  ) / exponential_term
							return str(constant_term / partial_sum  )[:-1]


if __name__ == "__main__":
			lowerCAmelCase_     =	50
			print(F"The first {n} digits of pi is: {pi(n)}")


