





class    _a  :

      """simple docstring"""


      def __init__(						self:	List[str]					,  __lowerCamelCase:	Any			):
          '''simple docstring'''


          UpperCamelCase__:					Dict												=      data
          UpperCamelCase__:					Optional[int]												=      None
          UpperCamelCase__:					Dict												=      None






      def __str__(						self:	Union[str, Any]			):
          '''simple docstring'''


          return F"{self.data}"




class    _a  :

      """simple docstring"""


      def __init__(						self:	str			):
          '''simple docstring'''


          UpperCamelCase__:					Optional[int]												=      None
          UpperCamelCase__:					Union[str, Any]												=      None






      def __iter__(						self:	int			):
          '''simple docstring'''


          UpperCamelCase__:					Tuple												=      self.head
          while node:
              yield node.data
              UpperCamelCase__:					List[str]												=      node.next






      def __str__(						self:	List[str]			):
          '''simple docstring'''


          return "->".join([str(snake_case_			) for item in self]			)






      def __len__(						self:	Optional[Any]			):
          '''simple docstring'''


          return sum(1 for _ in self			)






      def 	UpperCAmelCase_   (						self:	Union[str, Any]					,  __lowerCamelCase:	List[str]			):
          '''simple docstring'''


          self.insert_at_nth(0					,  snake_case_			)






      def 	UpperCAmelCase_   (						self:	Optional[Any]					,  __lowerCamelCase:	Union[str, Any]			):
          '''simple docstring'''


          self.insert_at_nth(len(self			)					,  snake_case_			)






      def 	UpperCAmelCase_   (						self:	Union[str, Any]					,  __lowerCamelCase:	str					,  __lowerCamelCase:	List[Any]			):
          '''simple docstring'''


          UpperCamelCase__:					Dict												=      len(self			)

          if not 0 <= index <= length:
              raise IndexError("list index out of range"			)
          UpperCamelCase__:					Dict												=      Node(snake_case_			)
          if self.head is None:
              UpperCamelCase__:					List[Any]												=      new_node
          elif index == 0:
              UpperCamelCase__:					int												=      new_node
              UpperCamelCase__:					Optional[Any]												=      self.head
              UpperCamelCase__:					Optional[int]												=      new_node
          elif index == length:
              UpperCamelCase__:					Optional[int]												=      new_node
              UpperCamelCase__:					str												=      self.tail
              UpperCamelCase__:					Union[str, Any]												=      new_node
          else:
              UpperCamelCase__:					Optional[int]												=      self.head
              for _ in range(0					,  snake_case_			):
                  UpperCamelCase__:					Optional[Any]												=      temp.next
              UpperCamelCase__:					Optional[int]												=      new_node
              UpperCamelCase__:					Optional[Any]												=      temp.previous
              UpperCamelCase__:					Optional[Any]												=      temp
              UpperCamelCase__:					Optional[int]												=      new_node






      def 	UpperCAmelCase_   (						self:	Optional[int]			):
          '''simple docstring'''


          return self.delete_at_nth(0			)






      def 	UpperCAmelCase_   (						self:	List[Any]			):
          '''simple docstring'''


          return self.delete_at_nth(len(self			) - 1			)






      def 	UpperCAmelCase_   (						self:	int					,  __lowerCamelCase:	Optional[int]			):
          '''simple docstring'''


          UpperCamelCase__:					str												=      len(self			)

          if not 0 <= index <= length - 1:
              raise IndexError("list index out of range"			)
          UpperCamelCase__:					List[Any]												=      self.head  # default first node
          if length == 1:
              UpperCamelCase__:					Any												=      None
          elif index == 0:
              UpperCamelCase__:					int												=      self.head.next
              UpperCamelCase__:					Any												=      None
          elif index == length - 1:
              UpperCamelCase__:					Optional[int]												=      self.tail
              UpperCamelCase__:					Dict												=      self.tail.previous
              UpperCamelCase__:					Optional[Any]												=      None
          else:
              UpperCamelCase__:					List[str]												=      self.head
              for _ in range(0					,  snake_case_			):
                  UpperCamelCase__:					Dict												=      temp.next
              UpperCamelCase__:					List[Any]												=      temp
              UpperCamelCase__:					Any												=      temp.previous
              UpperCamelCase__:					Optional[int]												=      temp.next
          return delete_node.data






      def 	UpperCAmelCase_   (						self:	Optional[Any]					,  __lowerCamelCase:	Dict			):
          '''simple docstring'''


          UpperCamelCase__:					Tuple												=      self.head

          while current.data != data:  # Find the position to delete
              if current.next:
                  UpperCamelCase__:					Dict												=      current.next
              else:  # We have reached the end an no value matches
                  raise ValueError("No data matching given value"			)

          if current == self.head:
              self.delete_head()

          elif current == self.tail:
              self.delete_tail()

          else:  # Before: 1 <--> 2(current) <--> 3
              UpperCamelCase__:					List[str]												=      current.next  # 1 --> 3
              UpperCamelCase__:					Any												=      current.previous  # 1 <--> 3
          return data






      def 	UpperCAmelCase_   (						self:	List[Any]			):
          '''simple docstring'''


          return len(self			) == 0



def 							lowerCAmelCase_				(    ):
    UpperCamelCase__:					Union[str, Any]												=      DoublyLinkedList()
    assert linked_list.is_empty() is True
    assert str(_lowerCamelCase) == ""

    try:
        linked_list.delete_head()
        raise AssertionError  # This should not happen.
    except IndexError:
        assert True  # This should happen.

    try:
        linked_list.delete_tail()
        raise AssertionError  # This should not happen.
    except IndexError:
        assert True  # This should happen.

    for i in range(10):
        assert len(_lowerCamelCase) == i
        linked_list.insert_at_nth(_lowerCamelCase  ,i + 1)
    assert str(_lowerCamelCase) == "->".join(str(_lowerCamelCase) for i in range(1  ,11))

    linked_list.insert_at_head(0)
    linked_list.insert_at_tail(11)
    assert str(_lowerCamelCase) == "->".join(str(_lowerCamelCase) for i in range(0  ,12))

    assert linked_list.delete_head() == 0
    assert linked_list.delete_at_nth(9) == 10
    assert linked_list.delete_tail() == 11
    assert len(_lowerCamelCase) == 9
    assert str(_lowerCamelCase) == "->".join(str(_lowerCamelCase) for i in range(1  ,10))


if __name__ == "__main__":
   from doctest import testmod

   testmod()








def 							lowerCAmelCase_				(    A_  ,A_  ,A_):
    UpperCamelCase__:					Optional[int]												=      [1 / first_term]
    UpperCamelCase__:					int												=      1 / first_term
    for _ in range(number_of_terms - 1):
        first_term += common_difference
        arithmetic_progression.append(A_)
    UpperCamelCase__:					str												=      [1 / step for step in arithmetic_progression]
    return sum(A_)


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   print(sum_of_harmonic_progression(1 / 2, 2, 2))

