




'''simple docstring'''


class 		lowerCAmelCase_     :







  '''simple docstring'''

  def __init__(      self							:				Any     )       ->						List[Any]:







       '''simple docstring'''



       A:						Dict						=						0
       A:						str						=						0
       A:						Dict						=						{}



  def  _snake_case			(      self							:				List[Any] ,   SCREAMING_SNAKE_CASE_							:				Union[str, Any]     )       ->						List[Any]:







       '''simple docstring'''



       if vertex not in self.adjacency:
            A:						List[str]						=						{}
            self.num_vertices += 1



  def  _snake_case			(      self							:				List[str] ,   SCREAMING_SNAKE_CASE_							:				Union[str, Any] ,   SCREAMING_SNAKE_CASE_							:				List[str] ,   SCREAMING_SNAKE_CASE_							:				Optional[Any]     )       ->						Any:







       '''simple docstring'''



       self.add_vertex(lowerCAmelCase__     )
       self.add_vertex(lowerCAmelCase__     )

       if head == tail:
            return

       A:						Tuple						=						weight
       A:						Tuple						=						weight



  def  _snake_case			(      self							:				Optional[int]     )       ->						Dict:







       '''simple docstring'''



       A:						Optional[Any]						=						self.get_edges()
       for edge in edges:
            A			,  A			,  A:						int						=						edge
            edges.remove((tail, head, weight)     )
       for i in range(len(lowerCAmelCase__     )     ):
            A:						Optional[int]						=						list(edges[i]     )

       edges.sort(key=lambda SCREAMING_SNAKE_CASE_     : e[2]     )
       for i in range(len(lowerCAmelCase__     ) - 1     ):
            if edges[i][2] >= edges[i + 1][2]:
                 A:						Optional[int]						=						edges[i][2] + 1
       for edge in edges:
            A			,  A			,  A:						str						=						edge
            A:						Optional[Any]						=						weight
            A:						int						=						weight



  def __str__(      self							:				Tuple     )       ->						str:







       '''simple docstring'''



       A:						List[str]						=						''''''
       for tail in self.adjacency:
            for head in self.adjacency[tail]:
                 A:						List[str]						=						self.adjacency[head][tail]
                 string += f"""{head} -> {tail} == {weight}\n"""
       return string.rstrip('''\n'''     )



  def  _snake_case			(      self							:				Union[str, Any]     )       ->						Tuple:







       '''simple docstring'''



       A:						List[str]						=						[]
       for tail in self.adjacency:
            for head in self.adjacency[tail]:
                 output.append((tail, head, self.adjacency[head][tail])     )
       return output



  def  _snake_case			(      self							:				int     )       ->						Union[str, Any]:







       '''simple docstring'''



       return self.adjacency.keys()



  @staticmethod
  def  _snake_case			(      SCREAMING_SNAKE_CASE_							:				List[str]=None ,   SCREAMING_SNAKE_CASE_							:				Tuple=None     )       ->						Optional[Any]:







       '''simple docstring'''



       A:						List[str]						=						Graph()
       if vertices is None:
            A:						Optional[Any]						=						[]
       if edges is None:
            A:						str						=						[]
       for vertex in vertices:
            g.add_vertex(lowerCAmelCase__     )
       for edge in edges:
            g.add_edge(*lowerCAmelCase__     )
       return g






  class 		lowerCAmelCase_     :







    '''simple docstring'''

    def __init__(      self							:				Any     )       ->						int:







         '''simple docstring'''



         A:						List[str]						=						{}
         A:						Dict						=						{}



    def __len__(      self							:				List[Any]     )       ->						Any:







         '''simple docstring'''



         return len(self.parent     )



    def  _snake_case			(      self							:				List[str] ,   SCREAMING_SNAKE_CASE_							:				List[Any]     )       ->						List[str]:







         '''simple docstring'''



         if item in self.parent:
              return self.find(lowerCAmelCase__     )

         A:						int						=						item
         A:						Any						=						0
         return item



    def  _snake_case			(      self							:				Union[str, Any] ,   SCREAMING_SNAKE_CASE_							:				Union[str, Any]     )       ->						List[Any]:







         '''simple docstring'''



         if item not in self.parent:
              return self.make_set(lowerCAmelCase__     )
         if item != self.parent[item]:
              A:						Dict						=						self.find(self.parent[item]     )
         return self.parent[item]




    def  _snake_case			(      self							:				Union[str, Any] ,   SCREAMING_SNAKE_CASE_							:				Tuple ,   SCREAMING_SNAKE_CASE_							:				Tuple     )       ->						str:







         '''simple docstring'''



         A:						Dict						=						self.find(lowerCAmelCase__     )
         A:						Optional[Any]						=						self.find(lowerCAmelCase__     )

         if roota == roota:
              return roota

         if self.rank[roota] > self.rank[roota]:
              A:						List[Any]						=						roota
              return roota

         if self.rank[roota] < self.rank[roota]:
              A:						Optional[Any]						=						roota
              return roota

         if self.rank[roota] == self.rank[roota]:
              self.rank[roota] += 1
              A:						List[str]						=						roota
              return roota
         return None






  @staticmethod
  def  _snake_case			(      SCREAMING_SNAKE_CASE_							:				List[str]     )       ->						str:







       '''simple docstring'''



       A:						List[str]						=						graph.num_vertices

       A:						Optional[Any]						=						Graph.UnionFind()
       A:						Union[str, Any]						=						[]
       while num_components > 1:
            A:						str						=						{}
            for vertex in graph.get_vertices():
                 A:						List[str]						=						-1

            A:						str						=						graph.get_edges()
            for edge in edges:
                 A			,  A			,  A:						Optional[int]						=						edge
                 edges.remove((tail, head, weight)     )
            for edge in edges:
                 A			,  A			,  A:						str						=						edge
                 A:						Optional[int]						=						union_find.find(lowerCAmelCase__     )
                 A:						List[str]						=						union_find.find(lowerCAmelCase__     )
                 if seta != seta:
                      if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
                           A:						Any						=						[head, tail, weight]

                      if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
                           A:						Union[str, Any]						=						[head, tail, weight]
            for vertex in cheap_edge:
                 if cheap_edge[vertex] != -1:
                      A			,  A			,  A:						Any						=						cheap_edge[vertex]
                      if union_find.find(lowerCAmelCase__     ) != union_find.find(lowerCAmelCase__     ):
                           union_find.union(lowerCAmelCase__ ,   lowerCAmelCase__     )
                           mst_edges.append(cheap_edge[vertex]     )
                           A:						Optional[Any]						=						num_components - 1
       A:						Optional[int]						=						Graph.build(edges=lowerCAmelCase__     )
       return mst







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





def 				UpperCAmelCase						(    lowercase							):







				"""simple docstring"""



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

				__lowercase 			=							precision
				__lowercase 			=							ceil(precision / 14							)
				__lowercase 			=							426880 * Decimal(10005							).sqrt()
				__lowercase 			=							1
				__lowercase 			=							13591409
				__lowercase 			=							Decimal(lowercase							)
				for k in range(1							,			lowercase							):
								__lowercase 			=							factorial(6 * k							) // (factorial(3 * k							) * factorial(lowercase							) ** 3)
								linear_term += 545140134
								exponential_term *= -262537412640768000
								partial_sum += Decimal(multinomial_term * linear_term							) / exponential_term
				return str(constant_term / partial_sum							)[:-1]


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