


"""simple docstring"""


from collections.abc import Iterable
from typing import Generic, TypeVar

_snake_case          =							TypeVar("_T")



class   _a      (      Generic[_T] ):
    def __init__( self							:					int							,					SCREAMING_SNAKE_CASE__							:					Iterable[_T] | None = None				):
          lowerCamelCase__           =		list(iterable or []				)
          lowerCamelCase__           =		[]
    def __len__( self							:					Any				):
          return len(self._stacka				) + len(self._stacka				)
    def __repr__( self							:					str				):
          return F'Queue({tuple(self._stacka[::-1] + self._stacka				)})'
    def      _UpperCamelCase       ( self							:					Dict							,					SCREAMING_SNAKE_CASE__							:					_T				):
          self._stacka.append(SCREAMING_SNAKE_CASE__				)


    def      _UpperCamelCase       ( self							:					int				):
          lowerCamelCase__           =		self._stacka.pop
          lowerCamelCase__           =		self._stacka.append

          if not self._stacka:
                while self._stacka:
                      stacka_append(stacka_pop()				)

          if not self._stacka:
                raise IndexError('Queue is empty'				)
          return self._stacka.pop()


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

   testmod()







"""simple docstring"""


# A Bipartite Graph is a graph whose vertices can be divided into two independent sets,
# U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
# from V to U. In other words, for every edge (u, v), either u belongs to U and v to V,
# or u belongs to V and v to U. We can also say that there is no edge that connects
# vertices of same set.



def   snake_case						(				_a:     Optional[Any]							)->		Union[str, Any]:
      '''simple docstring'''


      lowerCamelCase__           =		[False] * len(_a							)
      lowerCamelCase__           =		[-1] * len(_a							)

      def dfs(_a:     Any		,   _a:     Optional[int]							):
            lowerCamelCase__           =		True
            lowerCamelCase__           =		c
            for u in graph[v]:
                  if not visited[u]:
                        dfs(_a		,   1 - c							)

      for i in range(len(_a							)							):
            if not visited[i]:
                  dfs(_a		,   0							)

      for i in range(len(_a							)							):
            for j in graph[i]:
                  if color[i] == color[j]:
                        return False

      return True


# Adjacency list of graph
_snake_case          =							{0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: []}






print(check_bipartite_dfs(graph))



