

def 				__a							(       __A			,							__A						):
    SCREAMING_SNAKE_CASE__         =    len(UpperCAmelCase__						)
    SCREAMING_SNAKE_CASE__         =    len(UpperCAmelCase__						)
    SCREAMING_SNAKE_CASE__         =    (
        first_input_list_length
        if first_input_list_length > second_input_list_length
        else second_input_list_length
    )
    SCREAMING_SNAKE_CASE__         =    []
    for char_count in range(UpperCAmelCase__						):
        if char_count < first_input_list_length:
            output_result_list.append(first_input_list[char_count]						)
        if char_count < second_input_list_length:
            output_result_list.append(second_input_list[char_count]						)

    return output_result_list


if __name__ == "__main__":
  print(alternative_list_arrange(["A", "B", "C"], [1, 2, 3, 4, 5]), end=" ")



'''simple docstring'''




from __future__ import annotations




def 				lowerCamelCase      ( UpperCAmelCase__			:   str					)     -> Any:
							global graph, reversed_graph, scc, component, visit, stack
							if visit[u]:
														return
							lowercase_   :     int									=			True
							for v in graph[u]:
														dfs(UpperCAmelCase__					)
							stack.append(UpperCAmelCase__					)




def 				lowerCamelCase      ( UpperCAmelCase__			:   int					)     -> str:
							global graph, reversed_graph, scc, component, visit, stack
							if visit[u]:
														return
							lowercase_   :     Tuple									=			True
							component.append(UpperCAmelCase__					)
							for v in reversed_graph[u]:
														dfsa(UpperCAmelCase__					)




def 				lowerCamelCase      ( )     -> int:
							global graph, reversed_graph, scc, component, visit, stack
							for i in range(UpperCAmelCase__					):
														dfs(UpperCAmelCase__					)
							lowercase_   :     Optional[int]									=			[False] * n
							for i in stack[::-1]:
														if visit[i]:
																					continue
														lowercase_   :     Union[str, Any]									=			[]
														dfsa(UpperCAmelCase__					)
														scc.append(UpperCAmelCase__					)
							return scc


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

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

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





