
'''simple docstring'''

from __future__ import annotations

from collections.abc import Iterable
from dataclasses import dataclass
from typing import Any







class 	__lowerCAmelCase    :
     snake_case   :    int							      =      ("""_front""", """_back""", """_len""")







     @dataclass
     class 	__lowerCAmelCase    :
          snake_case   :    Any							      =      None
          snake_case   :    Deque._Node | None							      =      None
          snake_case   :    Deque._Node | None							      =      None







     class 	__lowerCAmelCase    :
          snake_case   :    int							      =      ("""_cur""",)



          def __init__(self						,	lowerCAmelCase__	):
               _UpperCAmelCase					:  int         =    cur



          def __iter__(self	):
               return self



          def     snake_case_ (self	):
               if self._cur is None:
                    # finished iterating
                    raise StopIteration
               _UpperCAmelCase					:  Union[str, Any]         =    self._cur.val
               _UpperCAmelCase					:  int         =    self._cur.next_node

               return val




     def __init__(self						,	lowerCAmelCase__ = None	):
          _UpperCAmelCase					:  Any         =    None
          _UpperCAmelCase					:  Any         =    None
          _UpperCAmelCase					:  int         =    0

          if iterable is not None:
               # append every value to the deque
               for val in iterable:
                    self.append(lowerCAmelCase__	)



     def     snake_case_ (self						,	lowerCAmelCase__	):
          _UpperCAmelCase					:  List[str]         =    self._Node(lowerCAmelCase__						,	lowerCAmelCase__						,	lowerCAmelCase__	)
          if self.is_empty():
               # front = back
               _UpperCAmelCase					:  Union[str, Any]         =    node
               _UpperCAmelCase					:  Dict         =    1
          else:
               # connect nodes
               _UpperCAmelCase					:  str         =    node
               _UpperCAmelCase					:  str         =    self._back
               _UpperCAmelCase					:  Union[str, Any]         =    node  # assign new back to the new node

               self._len += 1

               # make sure there were no errors
               assert not self.is_empty(), "Error on appending value."



     def     snake_case_ (self						,	lowerCAmelCase__	):
          _UpperCAmelCase					:  Optional[int]         =    self._Node(lowerCAmelCase__						,	lowerCAmelCase__						,	lowerCAmelCase__	)
          if self.is_empty():
               # front = back
               _UpperCAmelCase					:  int         =    node
               _UpperCAmelCase					:  Optional[Any]         =    1
          else:
               # connect nodes
               _UpperCAmelCase					:  Optional[Any]         =    self._front
               _UpperCAmelCase					:  List[str]         =    node
               _UpperCAmelCase					:  int         =    node  # assign new front to the new node

               self._len += 1

               # make sure there were no errors
               assert not self.is_empty(), "Error on appending value."



     def     snake_case_ (self						,	lowerCAmelCase__	):
          for val in iterable:
               self.append(lowerCAmelCase__	)



     def     snake_case_ (self						,	lowerCAmelCase__	):
          for val in iterable:
               self.appendleft(lowerCAmelCase__	)



     def     snake_case_ (self	):
          assert not self.is_empty(), "Deque is empty."

          _UpperCAmelCase					:  str         =    self._back
          _UpperCAmelCase					:  Union[str, Any]         =    self._back.prev_node  # set new back
          # drop the last node - python will deallocate memory automatically
          _UpperCAmelCase					:  int         =    None

          self._len -= 1

          return topop.val



     def     snake_case_ (self	):
          assert not self.is_empty(), "Deque is empty."

          _UpperCAmelCase					:  str         =    self._front
          _UpperCAmelCase					:  List[str]         =    self._front.next_node  # set new front and drop the first node
          _UpperCAmelCase					:  List[Any]         =    None

          self._len -= 1

          return topop.val



     def     snake_case_ (self	):
          return self._front is None



     def __len__(self	):
          return self._len



     def __eq__(self						,	lowerCAmelCase__	):

          if not isinstance(lowerCAmelCase__						,	lowerCAmelCase__	):
               return NotImplemented

          _UpperCAmelCase					:  List[str]         =    self._front
          _UpperCAmelCase					:  int         =    other._front

          # if the length of the dequeues are not the same, they are not equal
          if len(self	) != len(lowerCAmelCase__	):
               return False

          while me is not None and oth is not None:
               # compare every value
               if me.val != oth.val:
                    return False
               _UpperCAmelCase					:  str         =    me.next_node
               _UpperCAmelCase					:  Optional[int]         =    oth.next_node

          return True



     def __iter__(self	):
          return Deque._Iterator(self._front	)



     def __repr__(self	):
          _UpperCAmelCase					:  int         =    []
          _UpperCAmelCase					:  Optional[Any]         =    self._front
          while aux is not None:
               # append the values in a list to display
               values_list.append(aux.val	)
               _UpperCAmelCase					:  str         =    aux.next_node

          return F"[{', '.join(repr(lowerCAmelCase__	) for val in values_list	)}]"


if __name__ == "__main__":
   import doctest

   doctest.testmod()




'''simple docstring'''

from __future__ import annotations







def __A  (    lowerCAmelCase_       ):
     _UpperCAmelCase					:  Optional[int]         =    {1}
     _UpperCAmelCase					:  Union[str, Any]         =    [1]
     for _ in range(2 ,       depth + 1       ):
          _UpperCAmelCase					:  Dict         =    [*previous_coefficients, 0]
          _UpperCAmelCase					:  int         =    [0, *previous_coefficients]
          _UpperCAmelCase					:  List[Any]         =    []
          for x, y in zip(lowerCAmelCase_ ,       lowerCAmelCase_       ):
               coefficients.add(x + y       )
               previous_coefficients.append(x + y       )
     return coefficients







def __A  (    lowerCAmelCase_       ):
     _UpperCAmelCase					:  Dict         =    set()
     for number in unique_coefficients:
          _UpperCAmelCase					:  Tuple         =    2
          _UpperCAmelCase					:  List[str]         =    number
          while divisor**2 <= copy_number:
               _UpperCAmelCase					:  Tuple         =    0
               while copy_number % divisor == 0:
                    copy_number //= divisor
                    multiplicity += 1
               if multiplicity >= 2:
                    non_squarefrees.add(lowerCAmelCase_       )
                    break
               divisor += 1

     return unique_coefficients.difference(lowerCAmelCase_       )







def __A  (    lowerCAmelCase_ = 51       ):
     _UpperCAmelCase					:  List[str]         =    get_pascal_triangle_unique_coefficients(lowerCAmelCase_       )
     _UpperCAmelCase					:  Optional[Any]         =    get_squarefrees(lowerCAmelCase_       )
     return sum(lowerCAmelCase_       )


if __name__ == "__main__":
   print(F"{solution() = }")


