


class lowerCAmelCase_						:

 '''simple docstring'''

 def __init__(	self		,      _UpperCAmelCase					):
       snake_case_       =      data
       snake_case_       =      None
       snake_case_       =      None





 def __str__(	self					):
       return F'''{self.data}'''







class lowerCAmelCase_						:

 '''simple docstring'''

 def __init__(	self					):
       snake_case_       =      None
       snake_case_       =      None



 def __iter__(	self					):
       snake_case_       =      self.head
       while node:
             yield node.data
             snake_case_       =      node.next



 def __str__(	self					):
       return "->".join([str(_UpperCAmelCase					) for item in self]					)



 def __len__(	self					):
       return sum(1 for _ in self					)



 def 						UpperCamelCase__     (	self		,      _UpperCAmelCase					):
       self.insert_at_nth(0		,      _UpperCAmelCase					)



 def 						UpperCamelCase__     (	self		,      _UpperCAmelCase					):
       self.insert_at_nth(len(self					)		,      _UpperCAmelCase					)



 def 						UpperCamelCase__     (	self		,      _UpperCAmelCase		,      _UpperCAmelCase					):
       snake_case_       =      len(self					)

       if not 0 <= index <= length:
             raise IndexError('''list index out of range'''					)
       snake_case_       =      Node(_UpperCAmelCase					)
       if self.head is None:
             snake_case_       =      snake_case_       =      new_node
       elif index == 0:
             snake_case_       =      new_node
             snake_case_       =      self.head
             snake_case_       =      new_node
       elif index == length:
             snake_case_       =      new_node
             snake_case_       =      self.tail
             snake_case_       =      new_node
       else:
             snake_case_       =      self.head
             for _ in range(0		,      _UpperCAmelCase					):
                   snake_case_       =      temp.next
             snake_case_       =      new_node
             snake_case_       =      temp.previous
             snake_case_       =      temp
             snake_case_       =      new_node



 def 						UpperCamelCase__     (	self					):
       return self.delete_at_nth(0					)



 def 						UpperCamelCase__     (	self					):
       return self.delete_at_nth(len(self					) - 1					)



 def 						UpperCamelCase__     (	self		,      _UpperCAmelCase					):
       snake_case_       =      len(self					)

       if not 0 <= index <= length - 1:
             raise IndexError('''list index out of range'''					)
       snake_case_       =      self.head  # default first node
       if length == 1:
             snake_case_       =      snake_case_       =      None
       elif index == 0:
             snake_case_       =      self.head.next
             snake_case_       =      None
       elif index == length - 1:
             snake_case_       =      self.tail
             snake_case_       =      self.tail.previous
             snake_case_       =      None
       else:
             snake_case_       =      self.head
             for _ in range(0		,      _UpperCAmelCase					):
                   snake_case_       =      temp.next
             snake_case_       =      temp
             snake_case_       =      temp.previous
             snake_case_       =      temp.next
       return delete_node.data



 def 						UpperCamelCase__     (	self		,      _UpperCAmelCase					):
       snake_case_       =      self.head

       while current.data != data:  # Find the position to delete
             if current.next:
                   snake_case_       =      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
             snake_case_       =      current.next  # 1 --> 3
             snake_case_       =      current.previous  # 1 <--> 3
       return data





 def 						UpperCamelCase__     (	self					):
       return len(self					) == 0






def        __lowerCAmelCase    ()->  None:




      """simple docstring"""

      snake_case_       =      DoublyLinkedList()
      assert linked_list.is_empty() is True
      assert str(SCREAMING_SNAKE_CASE					) == ""

      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(SCREAMING_SNAKE_CASE					) == i
            linked_list.insert_at_nth(SCREAMING_SNAKE_CASE					,					i + 1					)
      assert str(SCREAMING_SNAKE_CASE					) == "->".join(str(SCREAMING_SNAKE_CASE					) for i in range(1					,					11					)					)

      linked_list.insert_at_head(0					)
      linked_list.insert_at_tail(11					)
      assert str(SCREAMING_SNAKE_CASE					) == "->".join(str(SCREAMING_SNAKE_CASE					) 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(SCREAMING_SNAKE_CASE					) == 9
      assert str(SCREAMING_SNAKE_CASE					) == "->".join(str(SCREAMING_SNAKE_CASE					) for i in range(1					,					10					)					)


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

   testmod()



UpperCAmelCase			=    10**8






def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					)->  bool:




      """simple docstring"""

      if n % 10 == 0:
            return False
      snake_case_       =      str(SCREAMING_SNAKE_CASE					)
      return s == s[::-1]






def        __lowerCAmelCase    ()->  int:




      """simple docstring"""

      snake_case_       =      set()
      snake_case_       =      1
      snake_case_       =      5
      while sum_squares < LIMIT:
            snake_case_       =      first_square + 1
            while sum_squares < LIMIT:
                  if is_palindrome(SCREAMING_SNAKE_CASE					):
                        answer.add(SCREAMING_SNAKE_CASE					)
                  last_square += 1
                  sum_squares += last_square**2
            first_square += 1
            snake_case_       =      first_square**2 + (first_square + 1) ** 2

      return sum(SCREAMING_SNAKE_CASE					)


if __name__ == "__main__":
   print(solution())