






from __future__ import annotations



def      UpperCAmelCase						( lowerCAmelCase__	):


		'''simple docstring'''

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



def      UpperCAmelCase						( lowerCAmelCase__	):


		'''simple docstring'''

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



def      UpperCAmelCase						( ):


		'''simple docstring'''

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


if __name__ == "__main__":
					# n - no of nodes, m - no of edges
					snake_case_      ,	snake_case_   :	Tuple							      =list(map(int, input().strip().split()))

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

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









from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


snake_case_   :	Optional[Any]							      =logging.get_logger(__name__)

snake_case_   :	Any							      ={
    '''MBZUAI/swiftformer-xs''': '''https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json''',
}





class        a__      (	lowerCAmelCase__		):
		UpperCAmelCase_							:       Union[str, Any] 					= 'swiftformer'






		def __init__(      self							, lowercase__=3							, lowercase__=[3, 3, 6, 4]							, lowercase__=[48, 56, 112, 220]							, lowercase__=4							, lowercase__=[True, True, True, True]							, lowercase__="gelu"							, lowercase__=3							, lowercase__=2							, lowercase__=1							, lowercase__=0.0							, lowercase__=True							, lowercase__=1e-5							, lowercase__=1e-5							, **lowercase__							, )				->				Optional[Any]:
				super().__init__(**lowercase__						)
				__A    =							num_channels
				__A    =							depths
				__A    =							embed_dims
				__A    =							mlp_ratio
				__A    =							downsamples
				__A    =							hidden_act
				__A    =							down_patch_size
				__A    =							down_stride
				__A    =							down_pad
				__A    =							drop_path_rate
				__A    =							use_layer_scale
				__A    =							layer_scale_init_value
				__A    =							batch_norm_eps





class        a__      (	lowerCAmelCase__		):
		UpperCAmelCase_							:       Union[str, Any] 					= version.parse('1.11'		)






		@property
		def 					_lowerCamelCase					(      self						)				->				Mapping[str, Mapping[int, str]]:
				return OrderedDict(
				    [
				        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
				    ]						)






		@property
		def 					_lowerCamelCase					(      self						)				->				float:
				return 1e-4

