



"""simple docstring"""





def 	__lowerCAmelCase						(		__UpperCamelCase      :			int					, __UpperCamelCase      :			int    ):


						'''simple docstring'''






						if number < 0 or shift_amount < 0:
												raise ValueError("""both inputs must be positive integers"""    )

						snake_case_   : Union[str, Any]						=			str(bin(__UpperCamelCase    )    )
						binary_number += "0" * shift_amount
						return binary_number
def 	__lowerCAmelCase						(		__UpperCamelCase      :			int					, __UpperCamelCase      :			int    ):


						'''simple docstring'''






						if number < 0 or shift_amount < 0:
												raise ValueError("""both inputs must be positive integers"""    )

						snake_case_   : List[Any]						=			str(bin(__UpperCamelCase    )    )[2:]
						if shift_amount >= len(__UpperCamelCase    ):
												return "0b0"
						snake_case_   : Dict						=			binary_number[: len(__UpperCamelCase    ) - shift_amount]
						return "0b" + shifted_binary_number
def 	__lowerCAmelCase						(		__UpperCamelCase      :			int					, __UpperCamelCase      :			int    ):


						'''simple docstring'''






						if number >= 0:  # Get binary representation of positive number
												snake_case_   : List[str]						=			"""0""" + str(bin(__UpperCamelCase    )    ).strip("""-"""    )[2:]
						else:  # Get binary (2's complement) representation of negative number
												snake_case_   : Optional[Any]						=			len(bin(__UpperCamelCase    )[3:]    )  # Find 2's complement of number
												snake_case_   : List[str]						=			bin(abs(__UpperCamelCase    ) - (1 << binary_number_length)    )[3:]
												snake_case_   : str						=			(
												    """1""" + """0""" * (binary_number_length - len(__UpperCamelCase    )) + binary_number
												)

						if shift_amount >= len(__UpperCamelCase    ):
												return "0b" + binary_number[0] * len(__UpperCamelCase    )
						return (
						    "0b"
						    + binary_number[0] * shift_amount
						    + binary_number[: len(__UpperCamelCase    ) - shift_amount]
						)


if __name__ == "__main__":
					import doctest

					doctest.testmod()






"""simple docstring"""





def 	__lowerCAmelCase						(		__UpperCamelCase      :			Union[str, Any]    ):


						'''simple docstring'''






						snake_case_   : int						=			[0] * len(__UpperCamelCase    )
						snake_case_   : List[str]						=			[]
						snake_case_   : Any						=			[1] * len(__UpperCamelCase    )

						for values in graph.values():
												for i in values:
																		indegree[i] += 1

						for i in range(len(__UpperCamelCase    )    ):
												if indegree[i] == 0:
																		queue.append(__UpperCamelCase    )

						while queue:
												snake_case_   : Optional[int]						=			queue.pop(0    )
												for x in graph[vertex]:
																		indegree[x] -= 1

																		if long_dist[vertex] + 1 > long_dist[x]:
																								snake_case_   : Union[str, Any]						=			long_dist[vertex] + 1

																		if indegree[x] == 0:
																								queue.append(__UpperCamelCase    )

						print(max(__UpperCamelCase    )    )


# Adjacency list of Graph
__lowerCAmelCase       :					str      					=					{0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}






longest_distance(graph)

