






class 						_a       :






  """simple docstring"""





  def __init__(     self		,		_UpperCAmelCase		,		_UpperCAmelCase=None		,		_UpperCAmelCase=None )			-> List[str]:
     UpperCamelCase_									=     data
     UpperCamelCase_									=     previous
     UpperCamelCase_									=     next_node




  def __str__(     self )			-> str:
     return f"""{self.data}"""




  def    _UpperCAmelCase     (     self )			-> int:
     return self.data




  def    _UpperCAmelCase     (     self )			-> Optional[Any]:
     return self.next




  def    _UpperCAmelCase     (     self )			-> Any:
     return self.previous




class 						_a       :






  """simple docstring"""





  def __init__(     self		,		_UpperCAmelCase )			-> Tuple:
     UpperCamelCase_									=     head




  def __iter__(     self )			-> str:
     return self




  def    _UpperCAmelCase     (     self )			-> Any:
     if not self.current:
        raise StopIteration
     else:
        UpperCamelCase_									=     self.current.get_data()
        UpperCamelCase_									=     self.current.get_next()
        return value




class 						_a       :






  """simple docstring"""





  def __init__(     self )			-> Union[str, Any]:
     UpperCamelCase_									=     None  # First node in list
     UpperCamelCase_									=     None  # Last node in list




  def __str__(     self )			-> Optional[Any]:
     UpperCamelCase_									=     self.head
     UpperCamelCase_									=     []
     while current is not None:
        nodes.append(current.get_data() )
        UpperCamelCase_									=     current.get_next()
     return " ".join(str(_UpperCAmelCase ) for node in nodes )




  def __contains__(     self		,		_UpperCAmelCase )			-> List[str]:
     UpperCamelCase_									=     self.head
     while current:
        if current.get_data() == value:
           return True
        UpperCamelCase_									=     current.get_next()
     return False




  def __iter__(     self )			-> Tuple:
     return LinkedListIterator(self.head )




  def    _UpperCAmelCase     (     self )			-> Tuple:
     if self.head:
        return self.head.get_data()
     return None




  def    _UpperCAmelCase     (     self )			-> Union[str, Any]:
     if self.tail:
        return self.tail.get_data()
     return None




  def    _UpperCAmelCase     (     self		,		_UpperCAmelCase )			-> None:
     if self.head is None:
        UpperCamelCase_									=     node
        UpperCamelCase_									=     node
     else:
        self.insert_before_node(self.head		,		_UpperCAmelCase )




  def    _UpperCAmelCase     (     self		,		_UpperCAmelCase )			-> None:
     if self.head is None:
        self.set_head(_UpperCAmelCase )
     else:
        self.insert_after_node(self.tail		,		_UpperCAmelCase )




  def    _UpperCAmelCase     (     self		,		_UpperCAmelCase )			-> None:
     UpperCamelCase_									=     Node(_UpperCAmelCase )
     if self.head is None:
        self.set_head(_UpperCAmelCase )
     else:
        self.set_tail(_UpperCAmelCase )




  def    _UpperCAmelCase     (     self		,		_UpperCAmelCase		,		_UpperCAmelCase )			-> None:
     UpperCamelCase_									=     node
     UpperCamelCase_									=     node.previous

     if node.get_previous() is None:
        UpperCamelCase_									=     node_to_insert
     else:
        UpperCamelCase_									=     node_to_insert

     UpperCamelCase_									=     node_to_insert




  def    _UpperCAmelCase     (     self		,		_UpperCAmelCase		,		_UpperCAmelCase )			-> None:
     UpperCamelCase_									=     node
     UpperCamelCase_									=     node.next

     if node.get_next() is None:
        UpperCamelCase_									=     node_to_insert
     else:
        UpperCamelCase_									=     node_to_insert

     UpperCamelCase_									=     node_to_insert




  def    _UpperCAmelCase     (     self		,		_UpperCAmelCase		,		_UpperCAmelCase )			-> None:
     UpperCamelCase_									=     1
     UpperCamelCase_									=     Node(_UpperCAmelCase )
     UpperCamelCase_									=     self.head
     while node:
        if current_position == position:
           self.insert_before_node(_UpperCAmelCase		,		_UpperCAmelCase )
           return
        current_position += 1
        UpperCamelCase_									=     node.next
     self.insert_after_node(self.tail		,		_UpperCAmelCase )




  def    _UpperCAmelCase     (     self		,		_UpperCAmelCase )			-> Node:
     UpperCamelCase_									=     self.head
     while node:
        if node.get_data() == item:
           return node
        UpperCamelCase_									=     node.get_next()
     raise Exception('Node not found' )




  def    _UpperCAmelCase     (     self		,		_UpperCAmelCase )			-> Tuple:
     if (node := self.get_node(_UpperCAmelCase )) is not None:
        if node == self.head:
           UpperCamelCase_									=     self.head.get_next()

        if node == self.tail:
           UpperCamelCase_									=     self.tail.get_previous()

        self.remove_node_pointers(_UpperCAmelCase )




  @staticmethod
  def    _UpperCAmelCase     (     _UpperCAmelCase )			-> None:
     if node.get_next():
        UpperCamelCase_									=     node.previous

     if node.get_previous():
        UpperCamelCase_									=     node.next

     UpperCamelCase_									=     None
     UpperCamelCase_									=     None




  def    _UpperCAmelCase     (     self )			-> Any:
     return self.head is None






def     _snake_case			():
   pass




if __name__ == "__main__":
 import doctest

 doctest.testmod()













snake_case__      :	List[Any]       	=      """Tobias Carryer"""

from time import time


class 						_a       :






  """simple docstring"""





  def __init__(     self		,		_UpperCAmelCase		,		_UpperCAmelCase		,		_UpperCAmelCase		,		_UpperCAmelCase=int(time() ) )			-> Tuple:  # noqa: B008
     UpperCamelCase_									=     multiplier
     UpperCamelCase_									=     increment
     UpperCamelCase_									=     modulo
     UpperCamelCase_									=     seed




  def    _UpperCAmelCase     (     self )			-> Any:
     UpperCamelCase_									=     (self.multiplier * self.seed + self.increment) % self.modulo
     return self.seed


if __name__ == "__main__":
 # Show the LCG in action.
 snake_case__      :	List[Any]       	=      LinearCongruentialGenerator(1_6_6_4_5_2_5, 1_0_1_3_9_0_4_2_2_3, 2 << 3_1)
 while True:
  print(lcg.next_number())





