




"""simple docstring"""







from __future__ import annotations





def     __snake_case   (							_lowercase						):


    """simple docstring"""







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





def     __snake_case   (							_lowercase						):


    """simple docstring"""







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





def     __snake_case   (							):


    """simple docstring"""







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


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

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

  SCREAMING_SNAKE_CASE_      =					[]
  SCREAMING_SNAKE_CASE_      =					[False] * n
  SCREAMING_SNAKE_CASE_      =					[]
  SCREAMING_SNAKE_CASE_      =					[]
  print(kosaraju())







"""simple docstring"""







import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig

class 							snake_case_ (				lowerCamelCase_ ):







   """simple docstring"""




   A_										=					CustomConfig







   def __init__(		self					,				lowerCamelCase_)							->      List[Any]:
       super().__init__(lowerCamelCase_)
       UpperCamelCase										=  torch.nn.Linear(config.hidden_size					,				config.hidden_size)







   def      UpperCAmelCase__ (		self					,				lowerCamelCase_)							->      Optional[Any]:
       return self.linear(lowerCamelCase_)







   def      UpperCAmelCase__ (		self					,				lowerCamelCase_)							->      List[str]:
       pass

class 							snake_case_ (				lowerCamelCase_ ):







   """simple docstring"""




   A_										=					NoSuperInitConfig







   def __init__(		self					,				lowerCamelCase_)							->      Optional[int]:
       super().__init__(lowerCamelCase_)
       UpperCamelCase										=  torch.nn.Linear(config.attribute					,				config.attribute)







   def      UpperCAmelCase__ (		self					,				lowerCamelCase_)							->      int:
       return self.linear(lowerCamelCase_)







   def      UpperCAmelCase__ (		self					,				lowerCamelCase_)							->      Any:
       pass