

import functools
import operator

from ...configuration_utils import PretrainedConfig
from ...utils import logging


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

SCREAMING_SNAKE_CASE		:Dict				  =    {
    """facebook/hubert-base-ls960""": """https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json""",
    # See all Hubert models at https://huggingface.co/models?filter=hubert
}






class 	__magic_name__				(       snake_case							):
     UpperCamelCase_  :Any								=			"""hubert"""






     def __init__(							self		,	_lowercase=32		,	_lowercase=768		,	_lowercase=12		,	_lowercase=12		,	_lowercase=3_072		,	_lowercase="gelu"		,	_lowercase=0.1		,	_lowercase=0.1		,	_lowercase=0.1		,	_lowercase=True		,	_lowercase=0.0		,	_lowercase=0.1		,	_lowercase=0.1		,	_lowercase=0.02		,	_lowercase=1e-5		,	_lowercase="group"		,	_lowercase="gelu"		,	_lowercase=(512, 512, 512, 512, 512, 512, 512)		,	_lowercase=(5, 2, 2, 2, 2, 2, 2)		,	_lowercase=(10, 3, 3, 3, 3, 2, 2)		,	_lowercase=False		,	_lowercase=128		,	_lowercase=16		,	_lowercase=False		,	_lowercase=True		,	_lowercase=0.05		,	_lowercase=10		,	_lowercase=2		,	_lowercase=0.0		,	_lowercase=10		,	_lowercase=0		,	_lowercase="sum"		,	_lowercase=False		,	_lowercase=False		,	_lowercase=256		,	_lowercase=0		,	_lowercase=1		,	_lowercase=2		,	**_lowercase		,	)->    str:
         super().__init__(**_lowercase		,	pad_token_id=_lowercase		,	bos_token_id=_lowercase		,	eos_token_id=_lowercase  )
         UpperCamelCase_      =	hidden_size
         UpperCamelCase_      =	feat_extract_norm
         UpperCamelCase_      =	feat_extract_activation
         UpperCamelCase_      =	list(_lowercase  )
         UpperCamelCase_      =	list(_lowercase  )
         UpperCamelCase_      =	list(_lowercase  )
         UpperCamelCase_      =	conv_bias
         UpperCamelCase_      =	num_conv_pos_embeddings
         UpperCamelCase_      =	num_conv_pos_embedding_groups
         UpperCamelCase_      =	len(self.conv_dim  )
         UpperCamelCase_      =	num_hidden_layers
         UpperCamelCase_      =	intermediate_size
         UpperCamelCase_      =	hidden_act
         UpperCamelCase_      =	num_attention_heads
         UpperCamelCase_      =	hidden_dropout
         UpperCamelCase_      =	attention_dropout
         UpperCamelCase_      =	activation_dropout
         UpperCamelCase_      =	feat_proj_layer_norm
         UpperCamelCase_      =	feat_proj_dropout
         UpperCamelCase_      =	final_dropout
         UpperCamelCase_      =	layerdrop
         UpperCamelCase_      =	layer_norm_eps
         UpperCamelCase_      =	initializer_range
         UpperCamelCase_      =	vocab_size
         UpperCamelCase_      =	do_stable_layer_norm
         UpperCamelCase_      =	use_weighted_layer_sum
         UpperCamelCase_      =	classifier_proj_size

         if (
             (len(self.conv_stride  ) != self.num_feat_extract_layers)
             or (len(self.conv_kernel  ) != self.num_feat_extract_layers)
             or (len(self.conv_dim  ) != self.num_feat_extract_layers)
         ):
             raise ValueError(
                 "Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =="
                 " `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ="
                 F" {len(self.conv_dim  )}`, `len(config.conv_stride) = {len(self.conv_stride  )}`,"
                 F" `len(config.conv_kernel) = {len(self.conv_kernel  )}`."  )

         # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
         UpperCamelCase_      =	apply_spec_augment
         UpperCamelCase_      =	mask_time_prob
         UpperCamelCase_      =	mask_time_length
         UpperCamelCase_      =	mask_time_min_masks
         UpperCamelCase_      =	mask_feature_prob
         UpperCamelCase_      =	mask_feature_length
         UpperCamelCase_      =	mask_feature_min_masks

         # ctc loss
         UpperCamelCase_      =	ctc_loss_reduction
         UpperCamelCase_      =	ctc_zero_infinity






     @property
     def   UpperCAmelCase_							(							self  )->    Tuple:
         return functools.reduce(operator.mul		,	self.conv_stride		,	1  )



from __future__ import annotations




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	str:



    """simple docstring"""






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




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	Dict:



    """simple docstring"""






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




def  lowerCAmelCase(			)->	Dict:



    """simple docstring"""






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


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

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

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