code: 
  
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  
  from __future__ import annotations
  
  
  
  
  
  
  
  class 							UpperCAmelCase_     :
  
  
  
  
       def __init__(							self  ,	_lowerCAmelCase		):
            UpperCAmelCase__			:     List[Any]										= data
            UpperCAmelCase__			:     Union[str, Any]										= None
  
  
  
  
  
  
  
  class 							UpperCAmelCase_     :
  
  
  
  
       def __init__(							self		):
            UpperCAmelCase__			:     List[str]										= None
  
  
  
  
       def      __UpperCAmelCase     (							self  ,	_lowerCAmelCase		):
            UpperCAmelCase__			:     Optional[Any]										= Node(__UpperCamelCase		)
            UpperCAmelCase__			:     List[str]										= self.head
            UpperCAmelCase__			:     List[str]										= new_node
            return self.head.data
  
  
  
  
       def      __UpperCAmelCase     (							self		):
            UpperCAmelCase__			:     List[str]										= self.head
            UpperCAmelCase__			:     List[str]										= self.head
            if self.head:
                 while fast_pointer and fast_pointer.next:
                      UpperCAmelCase__			:     Any										= fast_pointer.next.next
                      UpperCAmelCase__			:     Optional[int]										= slow_pointer.next
                 return slow_pointer.data
            else:
                 print("""No element found."""		)
                 return None
  
  
  if __name__ == "__main__":
        SCREAMING_SNAKE_CASE__		:       str   							=							LinkedList()
        for _ in range(int(input().strip())):
              SCREAMING_SNAKE_CASE__		:       Optional[int]   							=							int(input().strip())
              link.push(data)
        print(link.middle_element())
  
  
  
  
  
  
  
style_context: 
  
  
  
  
  
  
  import random
  
  
  
  
  
  
  
  class 							UpperCAmelCase_     :
  
  
  
  
       def __init__(							self  ,	_lowerCAmelCase  ,	_lowerCAmelCase		):
            UpperCAmelCase__			:     Union[str, Any]										= x
            UpperCAmelCase__			:     Union[str, Any]										= y
  
  
  
  
       def      __UpperCAmelCase     (							self		):
            return (self.x**2 + self.y**2) <= 1
  
  
  
  
       @classmethod
       def      __UpperCAmelCase     (							cls		):
            return cls(x=random.random()  ,	y=random.random()		)
  
  
  
  
  
  def    _lowerCamelCase	(	__lowerCamelCase					)   -> float:
  
       '''simple docstring'''
       if number_of_simulations < 1:
            raise ValueError("""At least one simulation is necessary to estimate PI."""					)
  
       UpperCAmelCase__			:     Dict										= 0
       for _ in range(__lowerCamelCase					):
            UpperCAmelCase__			:     Union[str, Any]										= Point.random_unit_square()
  
            if random_point.is_in_unit_circle():
                 number_in_unit_circle += 1
  
       return 4 * number_in_unit_circle / number_of_simulations
  
  
  if __name__ == "__main__":
        # import doctest
  
        # doctest.testmod()
        from math import pi
  
        SCREAMING_SNAKE_CASE__		:       List[str]   							=							"""Please enter the desired number of Monte Carlo simulations: """
        SCREAMING_SNAKE_CASE__		:       int   							=							estimate_pi(int(input(prompt).strip()))
        print(f'''An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}''')
  
  
  
  
  
  
  