



from __future__ import annotations






def 					a(   A :					Dict )	-> str:
					"""simple docstring"""





					global graph, reversed_graph, scc, component, visit, stack
					if visit[u]:
										return
					a        =     True
					for v in graph[u]:
										dfs(A )
					stack.append(A )






def 					a(   A :					str )	-> List[Any]:
					"""simple docstring"""





					global graph, reversed_graph, scc, component, visit, stack
					if visit[u]:
										return
					a        =     True
					component.append(A )
					for v in reversed_graph[u]:
										dfsa(A )






def 					a(   )	-> Union[str, Any]:
					"""simple docstring"""





					global graph, reversed_graph, scc, component, visit, stack
					for i in range(A ):
										dfs(A )
					a        =     [False] * n
					for i in stack[::-1]:
										if visit[i]:
															continue
										a        =     []
										dfsa(A )
										scc.append(A )
					return scc


if __name__ == "__main__":
				# n - no of nodes, m - no of edges
				_lowercase    ,       _lowercase:				Union[str, Any]       =	list(map(int, input().strip().split()))

				_lowercase:				list[list[int]]       =	[[] for _ in range(n)]  # graph
				_lowercase:				list[list[int]]       =	[[] for i in range(n)]  # reversed graph
				# input graph data (edges)
				for _ in range(m):
								_lowercase    ,       _lowercase:				Tuple       =	list(map(int, input().strip().split()))
								graph[u].append(v)
								reversed_graph[v].append(u)

				_lowercase:				list[int]       =	[]
				_lowercase:				list[bool]       =	[False] * n
				_lowercase:				list[int]       =	[]
				_lowercase:				list[int]       =	[]
				print(kosaraju())





import warnings

from ...utils import logging
from .image_processing_detr import DetrImageProcessor


_lowercase:				Optional[int]       =	logging.get_logger(__name__)



class 			_lowercase							(     lowerCAmelCase			):





	"""simple docstring"""




	def __init__(self	, *lowerCamelCase_	, **lowerCamelCase_	):
						"""simple docstring"""

						warnings.warn(
						    "The class DetrFeatureExtractor is deprecated and will be removed in version 5 of Transformers."
						    " Please use DetrImageProcessor instead."	, lowerCamelCase_	, )
						super().__init__(*lowerCamelCase_	, **lowerCamelCase_	)
