



"""simple docstring"""
A:     List[Any]										=	{0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

A:     Optional[Any]										=	{0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}

def    _snake_case		(		UpperCamelCase		:	Tuple    ,	UpperCamelCase		:	Tuple    ,	UpperCamelCase		:	Tuple		):
 UpperCAmelCase			:      List[str]			=			True
 UpperCAmelCase			:      Any			=			[]

 for neighbour in graph[vert]:
  if not visited[neighbour]:
   order += topology_sort(_lowercase    ,	_lowercase    ,	_lowercase		)

 order.append(_lowercase		)

 return order

def    _snake_case		(		UpperCamelCase		:	int    ,	UpperCamelCase		:	Tuple    ,	UpperCamelCase		:	Tuple		):
 UpperCAmelCase			:      Dict			=			True
 UpperCAmelCase			:      List[str]			=			[vert]

 for neighbour in reversed_graph[vert]:
  if not visited[neighbour]:
   component += find_components(_lowercase    ,	_lowercase    ,	_lowercase		)

 return component

def    _snake_case		(		UpperCamelCase		:	int		):
 UpperCAmelCase			:      Any			=			len(_lowercase		) * [False]
 UpperCAmelCase			:      List[Any]			=			{vert: [] for vert in range(len(_lowercase		)		)}

 for vert, neighbours in graph.items():
  for neighbour in neighbours:
   reversed_graph[neighbour].append(_lowercase		)

 UpperCAmelCase			:      Any			=			[]
 for i, was_visited in enumerate(_lowercase		):
  if not was_visited:
   order += topology_sort(_lowercase    ,	_lowercase    ,	_lowercase		)

 UpperCAmelCase			:      Tuple			=			[]
 UpperCAmelCase			:      Tuple			=			len(_lowercase		) * [False]

 for i in range(len(_lowercase		)		):
  UpperCAmelCase			:      Any			=			order[len(_lowercase		) - i - 1]
  if not visited[vert]:
   UpperCAmelCase			:      str			=			find_components(_lowercase    ,	_lowercase    ,	_lowercase		)
   components_list.append(_lowercase		)

 return components_list





"""simple docstring"""
from __future__ import annotations

from collections.abc import Iterable, Iterator
from dataclasses import dataclass

A:     List[Any]										=	(3, 9, -1_1, 0, 7, 5, 1, -1)
A:     Union[str, Any]										=	(4, 6, 2, 0, 8, 1_0, 3, -2)



@dataclass
class    SCREAMING_SNAKE_CASE__						:
   __lowerCAmelCase						:     int
   __lowerCAmelCase						:     Node | None



class    SCREAMING_SNAKE_CASE__						:

   def __init__(     self   ,  _SCREAMING_SNAKE_CASE		)						->   None:





    '''simple docstring'''




    UpperCAmelCase			:      Node | None			=			None
    for i in sorted(_SCREAMING_SNAKE_CASE   ,  reverse=_SCREAMING_SNAKE_CASE		):
     UpperCAmelCase			:      Union[str, Any]			=			Node(_SCREAMING_SNAKE_CASE   ,  self.head		)

   def __iter__(     self		)						->   Iterator[int]:





    '''simple docstring'''




    UpperCAmelCase			:      Optional[Any]			=			self.head
    while node:
     yield node.data
     UpperCAmelCase			:      List[str]			=			node.next_node

   def __len__(     self		)						->   int:





    '''simple docstring'''




    return sum(1 for _ in self		)




   def __str__(     self		)						->   str:





    '''simple docstring'''




    return " -> ".join([str(_SCREAMING_SNAKE_CASE		) for node in self]		)

def    _snake_case		(		UpperCamelCase		:	SortedLinkedList    ,	UpperCamelCase		:	SortedLinkedList		):
 return SortedLinkedList(list(UpperCamelCase		) + list(UpperCamelCase		)		)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      A:     Dict										=	SortedLinkedList
      print(merge_lists(SSL(test_data_odd), SSL(test_data_even)))
