

from __future__ import annotations

from typing import Any


class    A__ :



    def __init__(   self						,			UpperCamelCase__ = 6    )  -> None:





           '''simple docstring'''
           A_		   = None
           A_		   = None
           self.create_linked_list(UpperCamelCase__    )



    def    snake_case_     (   self						,			UpperCamelCase__    )  -> None:





           '''simple docstring'''
           A_		   = Node()
           A_		   = current_node
           A_		   = current_node
           A_		   = current_node
           for _ in range(1						,			UpperCamelCase__    ):
                  A_		   = Node()
                  A_		   = current_node
                  A_		   = previous_node
                  A_		   = current_node
           A_		   = self.front
           A_		   = previous_node



    def    snake_case_     (   self    )  -> bool:





           '''simple docstring'''
           return (
               self.front == self.rear
               and self.front is not None
               and self.front.data is None
           )



    def    snake_case_     (   self    )  -> Any | None:





           '''simple docstring'''
           self.check_can_perform_operation()
           return self.front.data if self.front else None



    def    snake_case_     (   self						,			UpperCamelCase__    )  -> None:





           '''simple docstring'''
           if self.rear is None:
                  return

           self.check_is_full()
           if not self.is_empty():
                  A_		   = self.rear.next
           if self.rear:
                  A_		   = data



    def    snake_case_     (   self    )  -> Any:





           '''simple docstring'''
           self.check_can_perform_operation()
           if self.rear is None or self.front is None:
                  return None
           if self.front == self.rear:
                  A_		   = self.front.data
                  A_		   = None
                  return data

           A_		   = self.front
           A_		   = old_front.next
           A_		   = old_front.data
           A_		   = None
           return data



    def    snake_case_     (   self    )  -> None:





           '''simple docstring'''
           if self.is_empty():
                  raise Exception("""Empty Queue"""    )







    def    snake_case_     (   self    )  -> None:





           '''simple docstring'''
           if self.rear and self.rear.next == self.front:
                  raise Exception("""Full Queue"""    )


class    A__ :



    def __init__(   self    )  -> None:





           '''simple docstring'''
           A_		   = None
           A_		   = None
           A_		   = None


if __name__ == "__main__":
      import doctest

      doctest.testmod()



'''simple docstring'''







def  UpperCAmelCase__      ( UpperCAmelCase__ = 1_00			)     ->     int:
       A_		   = n * (n + 1) * (2 * n + 1) / 6
       A_		   = (n * (n + 1) / 2) ** 2
       return int(square_of_sum - sum_of_squares			)


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