






'''simple docstring'''
def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase						,		_UpperCamelCase							):


			"""simple docstring"""




			return int((input_a, input_a).count(0							) == 0							)




def 		__SCREAMING_SNAKE_CASE					(  ):


			"""simple docstring"""




			assert and_gate(0						,		0							) == 0
			assert and_gate(0						,		1							) == 0
			assert and_gate(1						,		0							) == 0
			assert and_gate(1						,		1							) == 1


if __name__ == "__main__":
	test_and_gate()
	print(and_gate(1, 0))
	print(and_gate(0, 0))
	print(and_gate(0, 1))
	print(and_gate(1, 1))












'''simple docstring'''
import heapq as hq
import math
from collections.abc import Iterator


class        _UpperCAmelCase						:




    def __init__(			self  :       Optional[Any]  ,     a  :       Any			):






       '''simple docstring'''






       lowercase_	:    List[Any]           =     str(id_			)
       lowercase_	:    List[str]           =     None
       lowercase_	:    Tuple           =     None
       lowercase_	:    Dict           =     []
       lowercase_	:    Union[str, Any]           =     {}  # {vertex:distance}




    def __lt__(			self  :       Optional[Any]  ,     a  :       int			):






       '''simple docstring'''






       return self.key < other.key




    def __repr__(			self  :       Union[str, Any]			):






       '''simple docstring'''






       return self.id




    def 				lowerCAmelCase__				(			self  :       Union[str, Any]  ,     a  :       Optional[int]			):






       '''simple docstring'''






       self.neighbors.append(a			)





    def 				lowerCAmelCase__				(			self  :       Dict  ,     a  :       int  ,     a  :       Optional[int]			):






       '''simple docstring'''






       lowercase_	:    int           =     weight




def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase						,		_UpperCamelCase						,		_UpperCamelCase						,		_UpperCamelCase							):


   """simple docstring"""




   graph[a - 1].add_neighbor(graph[b - 1]							)
   graph[b - 1].add_neighbor(graph[a - 1]							)
   # add the edges:
   graph[a - 1].add_edge(graph[b - 1]						,		_UpperCamelCase							)
   graph[b - 1].add_edge(graph[a - 1]						,		_UpperCamelCase							)




def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase						,		_UpperCamelCase							):


   """simple docstring"""




   lowercase_	:    Any           =     []
   for u in graph:
      lowercase_	:    List[Any]           =     math.inf
      lowercase_	:    str           =     None
   lowercase_	:    Tuple           =     0
   lowercase_	:    Tuple           =     graph[:]
   while q:
      lowercase_	:    List[Any]           =     min(_UpperCamelCase							)
      q.remove(_UpperCamelCase							)
      for v in u.neighbors:
         if (v in q) and (u.edges[v.id] < v.key):
            lowercase_	:    Optional[int]           =     u
            lowercase_	:    Union[str, Any]           =     u.edges[v.id]
   for i in range(1						,		len(_UpperCamelCase							)							):
      a.append((int(graph[i].id							) + 1, int(graph[i].pi.id							) + 1)							)
   return a




def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase						,		_UpperCamelCase							):


   """simple docstring"""




   for u in graph:
      lowercase_	:    str           =     math.inf
      lowercase_	:    int           =     None
   lowercase_	:    List[Any]           =     0

   lowercase_	:    str           =     list(_UpperCamelCase							)
   hq.heapify(_UpperCamelCase							)

   while h:
      lowercase_	:    List[Any]           =     hq.heappop(_UpperCamelCase							)
      for v in u.neighbors:
         if (v in h) and (u.edges[v.id] < v.key):
            lowercase_	:    str           =     u
            lowercase_	:    Optional[int]           =     u.edges[v.id]
            hq.heapify(_UpperCamelCase							)

   for i in range(1						,		len(_UpperCamelCase							)							):
      yield (int(graph[i].id							) + 1, int(graph[i].pi.id							) + 1)




def 		__SCREAMING_SNAKE_CASE					(  ):


   """simple docstring"""






if __name__ == "__main__":
 import doctest

 doctest.testmod()




