
'''simple docstring'''





from __future__ import annotations





def     snake_case							(						UpperCAmelCase		)->     List[Any]:







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





def     snake_case							(						UpperCAmelCase		)->     List[Any]:







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





def     snake_case							(						)->     Any:







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


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

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

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








'''simple docstring'''





import math
import os

import cva
import numpy as np

a__						:				List[Any]           =    255.0





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase		)->     float:







      """simple docstring"""
      __A    		=     np.mean((original - contrast) ** 2		)
      if mse == 0:
            return 1_0_0

      return 2_0 * math.logaa(PIXEL_MAX / math.sqrt(UpperCAmelCase		)		)





def     snake_case							(						)->     None:







      """simple docstring"""
      __A    		=     os.path.dirname(os.path.realpath(UpperCAmelCase		)		)
      # Loading images (original image and compressed image)
      __A    		=     cva.imread(os.path.join(UpperCAmelCase ,					'image_data/original_image.png'		)		)
      __A    		=     cva.imread(os.path.join(UpperCAmelCase ,					'image_data/compressed_image.png'		) ,					1		)

      __A    		=     cva.imread(os.path.join(UpperCAmelCase ,					'image_data/PSNR-example-base.png'		)		)
      __A    		=     cva.imread(
          os.path.join(UpperCAmelCase ,					'image_data/PSNR-example-comp-10.jpg'		) ,					1		)

      # Value expected: 29.73dB
      print('-- First Test --'		)
      print(f'PSNR value is {peak_signal_to_noise_ratio(UpperCAmelCase ,					UpperCAmelCase		)} dB'		)

      # # Value expected: 31.53dB (Wikipedia Example)
      print('\n-- Second Test --'		)
      print(f'PSNR value is {peak_signal_to_noise_ratio(UpperCAmelCase ,					UpperCAmelCase		)} dB'		)


if __name__ == "__main__":
 main()






