
from __future__ import annotations

from typing import Any

class       a		:







       def __init__(						self  :  List[str]      ,				snake_case__  :  int = 6 ):
        """simple docstring"""







        __lowerCAmelCase         =							None
        __lowerCAmelCase         =							None
        self.create_linked_list(__A )







       def       UpperCAmelCase__					(						self  :  Union[str, Any]      ,				snake_case__  :  int ):
        """simple docstring"""







        __lowerCAmelCase         =							Node()
        __lowerCAmelCase         =							current_node
        __lowerCAmelCase         =							current_node
        __lowerCAmelCase         =							current_node
        for _ in range(1      ,				__A ):
         __lowerCAmelCase         =							Node()
         __lowerCAmelCase         =							current_node
         __lowerCAmelCase         =							previous_node
         __lowerCAmelCase         =							current_node
        __lowerCAmelCase         =							self.front
        __lowerCAmelCase         =							previous_node







       def       UpperCAmelCase__					(						self  :  int ):
        """simple docstring"""







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







       def       UpperCAmelCase__					(						self  :  Dict ):
        """simple docstring"""







        self.check_can_perform_operation()
        return self.front.data if self.front else None







       def       UpperCAmelCase__					(						self  :  Dict      ,				snake_case__  :  Any ):
        """simple docstring"""







        if self.rear is None:
         return

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







       def       UpperCAmelCase__					(						self  :  List[str] ):
        """simple docstring"""







        self.check_can_perform_operation()
        if self.rear is None or self.front is None:
         return None
        if self.front == self.rear:
         __lowerCAmelCase         =							self.front.data
         __lowerCAmelCase         =							None
         return data

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







       def       UpperCAmelCase__					(						self  :  Any ):
        """simple docstring"""







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







       def       UpperCAmelCase__					(						self  :  List[str] ):
        """simple docstring"""







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

class       a		:







       def __init__(						self  :  Dict ):
        """simple docstring"""







        __lowerCAmelCase         =							None
        __lowerCAmelCase         =							None
        __lowerCAmelCase         =							None


if __name__ == "__main__":
     import doctest

     doctest.testmod()








from abc import ABC, abstractmethod
from argparse import ArgumentParser

class       a		(   __UpperCAmelCase					):







							@staticmethod
							@abstractmethod
							def       UpperCAmelCase__					(						snake_case__  :  ArgumentParser ):
								"""simple docstring"""







								raise NotImplementedError()







							@abstractmethod
							def       UpperCAmelCase__					(						self  :  Any ):
								"""simple docstring"""







								raise NotImplementedError()






