



from collections import deque





def   __lowerCamelCase				(					__magic_name__		:     str  ):
							return input(A__  ).strip().split(" "  )





def   __lowerCamelCase				(					__magic_name__		:     Union[str, Any]   ,       __magic_name__		:     List[Any]  ):
							a__:				dict[int, list[int]] 							={}
							for i in range(A__  ):
														a__:				List[str] 							=[]

							for e in range(A__  ):
														a__:				Optional[int] 							=(int(A__  ) for i in _input(F"Edge {e + 1}: <node1> <node2> "  ))
														graph[x].append(A__  )
							return graph





def   __lowerCamelCase				(					__magic_name__		:     Any   ,       __magic_name__		:     int  ):
							a__:				dict[int, list[int]] 							={}
							for i in range(A__  ):
														a__:				Optional[Any] 							=[]

							for e in range(A__  ):
														a__:				str 							=(int(A__  ) for i in _input(F"Edge {e + 1}: <node1> <node2> "  ))
														graph[x].append(A__  )
														graph[y].append(A__  )
							return graph





def   __lowerCamelCase				(					__magic_name__		:     List[str]   ,       __magic_name__		:     Any  ):
							a__:				dict[int, list[tuple[int, int]]] 							={}
							for i in range(A__  ):
														a__:				Tuple 							=[]

							for e in range(A__  ):
														a__:				Union[str, Any] 							=(int(A__  ) for i in _input(F"Edge {e + 1}: <node1> <node2> <weight> "  ))
														graph[x].append((y, w)  )
														graph[y].append((x, w)  )
							return graph


if __name__ == "__main__":
		__UpperCAmelCase       =   (int(i) for i in _input('''Number of nodes and edges: '''))

		__UpperCAmelCase       =   int(
		    _input(
		        '''Press 1 or 2 or 3 \n'''
		        '''1. Unweighted directed \n'''
		        '''2. Unweighted undirected \n'''
		        '''3. Weighted undirected \n'''
		    )[0]
		)

		__UpperCAmelCase       =   {
		    1: initialize_unweighted_directed_graph,
		    2: initialize_unweighted_undirected_graph,
		    3: initialize_weighted_undirected_graph,
		}[graph_choice](n, m)





def   __lowerCamelCase				(					__magic_name__		:     List[Any]   ,       __magic_name__		:     Union[str, Any]  ):
							a__:				List[Any] 							={s}, [s]
							print(A__  )
							while _s:
														a__:				Optional[int] 							=0
														for i in g[_s[-1]]:
																					if i not in vis:
																												_s.append(A__  )
																												vis.add(A__  )
																												a__:				Optional[Any] 							=1
																												print(A__  )
																												break
														if not flag:
																					_s.pop()





def   __lowerCamelCase				(					__magic_name__		:     Union[str, Any]   ,       __magic_name__		:     Optional[int]  ):
							a__:				Dict 							={s}, deque([s]  )
							print(A__  )
							while q:
														a__:				Any 							=q.popleft()
														for v in g[u]:
																					if v not in vis:
																												vis.add(A__  )
																												q.append(A__  )
																												print(A__  )





def   __lowerCamelCase				(					__magic_name__		:     int   ,       __magic_name__		:     Dict  ):
							a__:				Optional[Any] 							={s: 0}, set(), {s: 0}
							while True:
														if len(A__  ) == len(A__  ) - 1:
																					break
														a__:				Any 							=100_000
														for i in dist:
																					if i not in known and dist[i] < mini:
																												a__:				List[str] 							=dist[i]
																												a__:				str 							=i
														known.add(A__  )
														for v in g[u]:
																					if v[0] not in known and dist[u] + v[1] < dist.get(v[0]   ,       100_000  ):
																												a__:				List[Any] 							=dist[u] + v[1]
																												a__:				List[Any] 							=u
							for i in dist:
														if i != s:
																					print(dist[i]  )





def   __lowerCamelCase				(					__magic_name__		:     Any   ,       __magic_name__		:     List[str]=None   ,       __magic_name__		:     Union[str, Any]=None  ):
							if q is None:
														a__:				str 							=[1]
							if ind is None:
														a__:				Optional[Any] 							=[0] * (len(A__  ) + 1)  # SInce oth Index is ignored
														for u in g:
																					for v in g[u]:
																												ind[v] += 1
														a__:				Any 							=deque()
														for i in g:
																					if ind[i] == 0:
																												q.append(A__  )
							if len(A__  ) == 0:
														return
							a__:				Optional[int] 							=q.popleft()
							print(A__  )
							for w in g[v]:
														ind[w] -= 1
														if ind[w] == 0:
																					q.append(A__  )
							topo(A__   ,       A__   ,       A__  )





def   __lowerCamelCase				(					):
							a__:				Any 							=input().strip()
							a__:				List[Any] 							=[]
							for _ in range(A__  ):
														a.append(map(A__   ,       input().strip().split()  )  )
							return a, n





def   __lowerCamelCase				(					__magic_name__		:     Tuple  ):
							(a__):				Tuple 							=a_and_n
							a__:				int 							=list(A__  )
							a__:				List[str] 							=[[0] * n for i in range(A__  )]
							for k in range(A__  ):
														for i in range(A__  ):
																					for j in range(A__  ):
																												if dist[i][j] > dist[i][k] + dist[k][j]:
																																			a__:				List[str] 							=dist[i][k] + dist[k][j]
																																			a__:				Optional[int] 							=k
							print(A__  )





def   __lowerCamelCase				(					__magic_name__		:     Optional[int]   ,       __magic_name__		:     int  ):
							a__:				Any 							={s: 0}, set(), {s: 0}
							while True:
														if len(A__  ) == len(A__  ) - 1:
																					break
														a__:				Union[str, Any] 							=100_000
														for i in dist:
																					if i not in known and dist[i] < mini:
																												a__:				Optional[Any] 							=dist[i]
																												a__:				Dict 							=i
														known.add(A__  )
														for v in g[u]:
																					if v[0] not in known and v[1] < dist.get(v[0]   ,       100_000  ):
																												a__:				int 							=v[1]
																												a__:				Union[str, Any] 							=u
							return dist





def   __lowerCamelCase				(					):
							a__:				int 							=map(A__   ,       input().split(" "  )  )
							a__:				Dict 							=[]
							for _ in range(A__  ):
														edges.append(map(A__   ,       input().split(" "  )  )  )
							return edges, n





def   __lowerCamelCase				(					__magic_name__		:     Optional[Any]  ):
							# Sort edges on the basis of distance
							(a__):				Dict 							=e_and_n
							e.sort(reverse=A__   ,       key=lambda __magic_name__  : x[2]  )
							a__:				Any 							=[{i} for i in range(1   ,       n + 1  )]
							while True:
														if len(A__  ) == 1:
																					break
														print(A__  )
														a__:				Tuple 							=e.pop()
														for i in range(len(A__  )  ):
																					if x[0] in s[i]:
																												break
														for j in range(len(A__  )  ):
																					if x[1] in s[j]:
																												if i == j:
																																			break
																												s[j].update(s[i]  )
																												s.pop(A__  )
																												break







def   __lowerCamelCase				(					__magic_name__		:     List[Any]  ):
							a__:				Optional[int] 							=[]
							for node in graph:
														if not graph[node]:
																					isolated.append(A__  )
							return isolated









import warnings

from ...utils import logging
from .image_processing_vilt import ViltImageProcessor


lowerCAmelCase__       :	int     				=logging.get_logger(__name__)







class      __lowercase  (__SCREAMING_SNAKE_CASE   ):





							"""simple docstring"""







							def __init__(	self       ,		*lowerCAmelCase__       ,		**lowerCAmelCase__    ):





										"""simple docstring"""




										warnings.warn(
										    'The class ViltFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'
										    ' use ViltImageProcessor instead.'       ,		lowerCAmelCase__       ,		)
										super().__init__(*lowerCAmelCase__       ,		**lowerCAmelCase__    )





