code: 
  
  
  
  
  
  
  import math
  
  class 					snake_case_							:
  
  
  
  
  
  
  
     """simple docstring"""
  
  
  
     def __init__(    self:	Dict   ,       snake_case__:	Optional[Any]	)  ->		List[Any]:
  
  
         """simple docstring"""
  
  
  
         _lowercase     =	len(snake_case__	)
         _lowercase     =	[0] * (
             4 * self.N
         )  # approximate the overall size of segment tree with array N
         self.build(1   ,       0   ,       self.N - 1	)
  
     def 			SCREAMING_SNAKE_CASE__				(    self:	Dict   ,       snake_case__:	Optional[int]	)  ->		List[str]:
  
  
         """simple docstring"""
  
  
  
         return idx * 2
  
     def 			SCREAMING_SNAKE_CASE__				(    self:	Any   ,       snake_case__:	List[Any]	)  ->		Any:
  
  
         """simple docstring"""
  
  
  
         return idx * 2 + 1
  
     def 			SCREAMING_SNAKE_CASE__				(    self:	Union[str, Any]   ,       snake_case__:	Optional[int]   ,       snake_case__:	Optional[int]   ,       snake_case__:	Optional[Any]	)  ->		Union[str, Any]:  # noqa: E741
  
  
         """simple docstring"""
  
  
  
         if l == r:
             _lowercase     =	A[l]
         else:
             _lowercase     =	(l + r) // 2
             self.build(self.left(snake_case__	)   ,       snake_case__   ,       snake_case__	)
             self.build(self.right(snake_case__	)   ,       mid + 1   ,       snake_case__	)
             _lowercase     =	max(self.st[self.left(snake_case__	)]   ,       self.st[self.right(snake_case__	)]	)
  
     def 			SCREAMING_SNAKE_CASE__				(    self:	int   ,       snake_case__:	Tuple   ,       snake_case__:	str   ,       snake_case__:	Optional[int]	)  ->		Tuple:
  
  
         """simple docstring"""
  
  
  
         return self.update_recursive(1   ,       0   ,       self.N - 1   ,       a - 1   ,       b - 1   ,       snake_case__	)
  
     def 			SCREAMING_SNAKE_CASE__				(    self:	Optional[Any]   ,       snake_case__:	Optional[Any]   ,       snake_case__:	Dict   ,       snake_case__:	int   ,       snake_case__:	Any   ,       snake_case__:	Tuple   ,       snake_case__:	List[str]	)  ->		Optional[Any]:  # noqa: E741
  
  
         """simple docstring"""
  
  
  
         if r < a or l > b:
             return True
         if l == r:
             _lowercase     =	val
             return True
         _lowercase     =	(l + r) // 2
         self.update_recursive(self.left(snake_case__	)   ,       snake_case__   ,       snake_case__   ,       snake_case__   ,       snake_case__   ,       snake_case__	)
         self.update_recursive(self.right(snake_case__	)   ,       mid + 1   ,       snake_case__   ,       snake_case__   ,       snake_case__   ,       snake_case__	)
         _lowercase     =	max(self.st[self.left(snake_case__	)]   ,       self.st[self.right(snake_case__	)]	)
         return True
  
     def 			SCREAMING_SNAKE_CASE__				(    self:	Optional[int]   ,       snake_case__:	Tuple   ,       snake_case__:	List[str]	)  ->		Union[str, Any]:
  
  
         """simple docstring"""
  
  
  
         return self.query_recursive(1   ,       0   ,       self.N - 1   ,       a - 1   ,       b - 1	)
  
     def 			SCREAMING_SNAKE_CASE__				(    self:	Optional[Any]   ,       snake_case__:	Tuple   ,       snake_case__:	Tuple   ,       snake_case__:	str   ,       snake_case__:	int   ,       snake_case__:	Tuple	)  ->		List[str]:  # noqa: E741
  
  
         """simple docstring"""
  
  
  
         if r < a or l > b:
             return -math.inf
         if l >= a and r <= b:
             return self.st[idx]
         _lowercase     =	(l + r) // 2
         _lowercase     =	self.query_recursive(self.left(snake_case__	)   ,       snake_case__   ,       snake_case__   ,       snake_case__   ,       snake_case__	)
         _lowercase     =	self.query_recursive(self.right(snake_case__	)   ,       mid + 1   ,       snake_case__   ,       snake_case__   ,       snake_case__	)
         return max(snake_case__   ,       snake_case__	)
  
     def 			SCREAMING_SNAKE_CASE__				(    self:	Optional[int]	)  ->		Dict:
  
  
         """simple docstring"""
  
  
  
         _lowercase     =	[]
         for i in range(1   ,       N + 1	):
             show_list += [self.query(snake_case__   ,       snake_case__	)]
         print(snake_case__	)
  
  
  if __name__ == "__main__":
     lowerCamelCase										=  [1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
     lowerCamelCase										=  15
     lowerCamelCase										=  SegmentTree(A)
     print(segt.query(4, 6))
     print(segt.query(7, 11))
     print(segt.query(7, 12))
     segt.update(1, 3, 111)
     print(segt.query(1, 15))
     segt.update(7, 8, 235)
     segt.show_data()
  
style_context: 
  
  
  
  
  
  
  from __future__ import annotations
  def        UpperCAmelCase      (   _lowercase      ):
  
  
      '''simple docstring'''
  
  
  
      global graph, reversed_graph, scc, component, visit, stack
      if visit[u]:
          return
      _lowercase     =	True
      for v in graph[u]:
          dfs(_lowercase      )
      stack.append(_lowercase      )
  def        UpperCAmelCase      (   _lowercase      ):
  
  
      '''simple docstring'''
  
  
  
      global graph, reversed_graph, scc, component, visit, stack
      if visit[u]:
          return
      _lowercase     =	True
      component.append(_lowercase      )
      for v in reversed_graph[u]:
          dfsa(_lowercase      )
  def        UpperCAmelCase      (   ):
  
  
      '''simple docstring'''
  
  
  
      global graph, reversed_graph, scc, component, visit, stack
      for i in range(_lowercase      ):
          dfs(_lowercase      )
      _lowercase     =	[False] * n
      for i in stack[::-1]:
          if visit[i]:
              continue
          _lowercase     =	[]
          dfsa(_lowercase      )
          scc.append(_lowercase      )
      return scc
  
  
  if __name__ == "__main__":
     # n - no of nodes, m - no of edges
     lowerCamelCase						,		lowerCamelCase										=  list(map(int, input().strip().split()))
  
     lowerCamelCase										=  [[] for _ in range(n)]  # graph
     lowerCamelCase										=  [[] for i in range(n)]  # reversed graph
     # input graph data (edges)
     for _ in range(m):
        lowerCamelCase						,		lowerCamelCase										=  list(map(int, input().strip().split()))
        graph[u].append(v)
        reversed_graph[v].append(u)
  
     lowerCamelCase										=  []
     lowerCamelCase										=  [False] * n
     lowerCamelCase										=  []
     lowerCamelCase										=  []
     print(kosaraju())
  