





import sys
from collections import defaultdict
class SCREAMING_SNAKE_CASE_  :






						def __init__(					self					:					Dict		)							->			str:







							"""simple docstring"""


							snake_case_						:	Any      =		[]






						def UpperCAmelCase_ (					self					:					List[str]						,      _A					:					str		)							->			int:







							"""simple docstring"""


							return self.node_position[vertex]






						def UpperCAmelCase_ (					self					:					Tuple						,      _A					:					List[str]						,      _A					:					Optional[Any]		)							->			int:







							"""simple docstring"""


							snake_case_						:	Dict      =		pos






						def UpperCAmelCase_ (					self					:					List[Any]						,      _A					:					Optional[int]						,      _A					:					str						,      _A					:					Union[str, Any]						,      _A					:					int		)							->			Any:







							"""simple docstring"""


							if start > size // 2 - 1:
								return
							else:
								if 2 * start + 2 >= size:
									snake_case_						:	str      =		2 * start + 1
								else:
									if heap[2 * start + 1] < heap[2 * start + 2]:
										snake_case_						:	str      =		2 * start + 1
									else:
										snake_case_						:	int      =		2 * start + 2
								if heap[smallest_child] < heap[start]:
									snake_case_  ,snake_case_						:	Dict      =		heap[smallest_child], positions[smallest_child]
									snake_case_  ,snake_case_						:	List[str]      =		(
									    heap[start],
									    positions[start],
									)
									snake_case_  ,snake_case_						:	Optional[int]      =		temp, tempa

									snake_case_						:	Any      =		self.get_position(positions[smallest_child]		)
									self.set_position(
									    positions[smallest_child]						,      self.get_position(positions[start]		)		)
									self.set_position(positions[start]						,      __lowerCAmelCase		)

									self.top_to_bottom(__lowerCAmelCase						,      __lowerCAmelCase						,      __lowerCAmelCase						,      __lowerCAmelCase		)






						def UpperCAmelCase_ (					self					:					Optional[Any]						,      _A					:					Tuple						,      _A					:					Union[str, Any]						,      _A					:					Union[str, Any]						,      _A					:					List[Any]		)							->			Optional[int]:







							"""simple docstring"""


							snake_case_						:	int      =		position[index]

							while index != 0:
								snake_case_						:	Union[str, Any]      =		int((index - 2) / 2		) if index % 2 == 0 else int((index - 1) / 2		)

								if val < heap[parent]:
									snake_case_						:	List[Any]      =		heap[parent]
									snake_case_						:	Union[str, Any]      =		position[parent]
									self.set_position(position[parent]						,      __lowerCAmelCase		)
								else:
									snake_case_						:	Tuple      =		val
									snake_case_						:	Optional[Any]      =		temp
									self.set_position(__lowerCAmelCase						,      __lowerCAmelCase		)
									break
								snake_case_						:	Union[str, Any]      =		parent
							else:
								snake_case_						:	Union[str, Any]      =		val
								snake_case_						:	Union[str, Any]      =		temp
								self.set_position(__lowerCAmelCase						,      0		)






						def UpperCAmelCase_ (					self					:					Union[str, Any]						,      _A					:					Tuple						,      _A					:					Optional[Any]		)							->			List[Any]:







							"""simple docstring"""


							snake_case_						:	Optional[int]      =		len(__lowerCAmelCase		) // 2 - 1
							for i in range(__lowerCAmelCase						,      -1						,      -1		):
								self.top_to_bottom(__lowerCAmelCase						,      __lowerCAmelCase						,      len(__lowerCAmelCase		)						,      __lowerCAmelCase		)






						def UpperCAmelCase_ (					self					:					List[Any]						,      _A					:					List[Any]						,      _A					:					Dict		)							->			Dict:







							"""simple docstring"""


							snake_case_						:	int      =		positions[0]
							snake_case_						:	Optional[Any]      =		sys.maxsize
							self.top_to_bottom(__lowerCAmelCase						,      0						,      len(__lowerCAmelCase		)						,      __lowerCAmelCase		)
							return temp


def 							SCREAMING_SNAKE_CASE__  (			__a      ):
	snake_case_						:	Optional[int]      =		Heap()

	snake_case_						:	Dict      =		[0] * len(lowerCAmelCase__      )
	snake_case_						:	Optional[Any]      =		[-1] * len(lowerCAmelCase__      )  # Neighboring Tree Vertex of selected vertex
	# Minimum Distance of explored vertex with neighboring vertex of partial tree
	# formed in graph
	snake_case_						:	Optional[int]      =		[]  # Heap of Distance of vertices from their neighboring vertex
	snake_case_						:	List[str]      =		[]

	for vertex in range(len(lowerCAmelCase__      )      ):
		distance_tv.append(sys.maxsize      )
		positions.append(lowerCAmelCase__      )
		heap.node_position.append(lowerCAmelCase__      )

	snake_case_						:	Tuple      =		[]
	snake_case_						:	Tuple      =		1
	snake_case_						:	Dict      =		sys.maxsize
	for neighbor, distance in adjacency_list[0]:
		snake_case_						:	str      =		0
		snake_case_						:	int      =		distance
	heap.heapify(lowerCAmelCase__      ,       lowerCAmelCase__      )

	for _ in range(1      ,       len(lowerCAmelCase__      )      ):
		snake_case_						:	Optional[Any]      =		heap.delete_minimum(lowerCAmelCase__      ,       lowerCAmelCase__      )
		if visited[vertex] == 0:
			tree_edges.append((nbr_tv[vertex], vertex)      )
			snake_case_						:	Optional[Any]      =		1
			for neighbor, distance in adjacency_list[vertex]:
				if (
				    visited[neighbor] == 0
				    and distance < distance_tv[heap.get_position(lowerCAmelCase__      )]
				):
					snake_case_						:	Optional[Any]      =		distance
					heap.bottom_to_top(
					    lowerCAmelCase__      ,       heap.get_position(lowerCAmelCase__      )      ,       lowerCAmelCase__      ,       lowerCAmelCase__      )
					snake_case_						:	Optional[int]      =		vertex
	return tree_edges


if __name__ == "__main__":  # pragma: no cover
						# < --------- Prims Algorithm --------- >
						_SCREAMING_SNAKE_CASE							=						int(input("""Enter number of edges: """).strip())
						_SCREAMING_SNAKE_CASE							=						defaultdict(list)
						for _ in range(edges_number):
												_SCREAMING_SNAKE_CASE							=						[int(x) for x in input().strip().split()]
												adjacency_list[edge[0]].append([edge[1], edge[2]])
												adjacency_list[edge[1]].append([edge[0], edge[2]])
						print(prisms_algorithm(adjacency_list))


"""simple docstring"""






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


def 			UpperCAmelCase__       (				lowerCAmelCase__     :int		) ->    str:
      '''simple docstring'''


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

      lowercase														=	precision
      lowercase														=	ceil(precision / 1_4		)
      lowercase														=	4_2_6_8_8_0 * Decimal(1_0_0_0_5		).sqrt()
      lowercase														=	1
      lowercase														=	1_3_5_9_1_4_0_9
      lowercase														=	Decimal(lowerCAmelCase__		)
      for k in range(1					,		lowerCAmelCase__		):
            lowercase														=	factorial(6 * k		) // (factorial(3 * k		) * factorial(lowerCAmelCase__		) ** 3)
            linear_term += 5_4_5_1_4_0_1_3_4
            exponential_term *= -2_6_2_5_3_7_4_1_2_6_4_0_7_6_8_0_0_0
            partial_sum += Decimal(multinomial_term * linear_term		) / exponential_term
      return str(constant_term / partial_sum		)[:-1]


if __name__ == "__main__":
       __lowerCAmelCase    :       List[Any]					     =5_0
       print(F"""The first {n} digits of pi is: {pi(n)}""")



