


class 							A   :
					'''simple docstring'''






					def __init__(self   :						Tuple		)						->       Optional[int]:




							"""simple docstring"""


							lowercase__					      =		0
							lowercase__					      =		0
							lowercase__					      =		{}

					def   lowerCamelCase__					(self   :						List[Any]				, _UpperCAmelCase   :						Dict		)						->       List[str]:




							"""simple docstring"""


							if vertex not in self.adjacency:
									lowercase__					      =		{}
									self.num_vertices += 1

					def   lowerCamelCase__					(self   :						Union[str, Any]				, _UpperCAmelCase   :						int				, _UpperCAmelCase   :						str				, _UpperCAmelCase   :						Any		)						->       int:




							"""simple docstring"""


							self.add_vertex(_UpperCAmelCase		)
							self.add_vertex(_UpperCAmelCase		)

							if head == tail:
									return

							lowercase__					      =		weight
							lowercase__					      =		weight

					def   lowerCamelCase__					(self   :						Optional[int]		)						->       Optional[Any]:




							"""simple docstring"""


							lowercase__					      =		self.get_edges()
							for edge in edges:
									lowercase__      ,     lowercase__      ,     lowercase__					      =		edge
									edges.remove((tail, head, weight)		)
							for i in range(len(_UpperCAmelCase		)		):
									lowercase__					      =		list(edges[i]		)

							edges.sort(key=lambda _UpperCAmelCase		: e[2]		)
							for i in range(len(_UpperCAmelCase		) - 1		):
									if edges[i][2] >= edges[i + 1][2]:
											lowercase__					      =		edges[i][2] + 1
							for edge in edges:
									lowercase__      ,     lowercase__      ,     lowercase__					      =		edge
									lowercase__					      =		weight
									lowercase__					      =		weight

					def __str__(self   :						Union[str, Any]		)						->       Optional[Any]:




							"""simple docstring"""


							lowercase__					      =		""""""
							for tail in self.adjacency:
									for head in self.adjacency[tail]:
											lowercase__					      =		self.adjacency[head][tail]
											string += f'''{head} -> {tail} == {weight}\n'''
							return string.rstrip("""\n"""		)

					def   lowerCamelCase__					(self   :						Dict		)						->       Optional[int]:




							"""simple docstring"""


							lowercase__					      =		[]
							for tail in self.adjacency:
									for head in self.adjacency[tail]:
											output.append((tail, head, self.adjacency[head][tail])		)
							return output

					def   lowerCamelCase__					(self   :						Tuple		)						->       List[str]:




							"""simple docstring"""


							return self.adjacency.keys()

					@staticmethod
					def   lowerCamelCase__					(_UpperCAmelCase   :						List[str]=None				, _UpperCAmelCase   :						Any=None		)						->       List[str]:




							"""simple docstring"""


							lowercase__					      =		Graph()
							if vertices is None:
									lowercase__					      =		[]
							if edges is None:
									lowercase__					      =		[]
							for vertex in vertices:
									g.add_vertex(_UpperCAmelCase		)
							for edge in edges:
									g.add_edge(*_UpperCAmelCase		)
							return g



					class 							A   :
										'''simple docstring'''






										def __init__(self   :						int		)						->       int:




												"""simple docstring"""


												lowercase__					      =		{}
												lowercase__					      =		{}

										def __len__(self   :						Any		)						->       Dict:




												"""simple docstring"""


												return len(self.parent		)

										def   lowerCamelCase__					(self   :						Dict				, _UpperCAmelCase   :						str		)						->       int:




												"""simple docstring"""


												if item in self.parent:
														return self.find(_UpperCAmelCase		)

												lowercase__					      =		item
												lowercase__					      =		0
												return item

										def   lowerCamelCase__					(self   :						List[str]				, _UpperCAmelCase   :						List[Any]		)						->       List[str]:




												"""simple docstring"""


												if item not in self.parent:
														return self.make_set(_UpperCAmelCase		)
												if item != self.parent[item]:
														lowercase__					      =		self.find(self.parent[item]		)
												return self.parent[item]


										def   lowerCamelCase__					(self   :						Dict				, _UpperCAmelCase   :						Optional[Any]				, _UpperCAmelCase   :						Optional[int]		)						->       Optional[Any]:




												"""simple docstring"""


												lowercase__					      =		self.find(_UpperCAmelCase		)
												lowercase__					      =		self.find(_UpperCAmelCase		)

												if roota == roota:
														return roota

												if self.rank[roota] > self.rank[roota]:
														lowercase__					      =		roota
														return roota

												if self.rank[roota] < self.rank[roota]:
														lowercase__					      =		roota
														return roota

												if self.rank[roota] == self.rank[roota]:
														self.rank[roota] += 1
														lowercase__					      =		roota
														return roota
												return None






					@staticmethod
					def   lowerCamelCase__					(_UpperCAmelCase   :						Dict		)						->       Union[str, Any]:




							"""simple docstring"""


							lowercase__					      =		graph.num_vertices

							lowercase__					      =		Graph.UnionFind()
							lowercase__					      =		[]
							while num_components > 1:
									lowercase__					      =		{}
									for vertex in graph.get_vertices():
											lowercase__					      =		-1

									lowercase__					      =		graph.get_edges()
									for edge in edges:
											lowercase__      ,     lowercase__      ,     lowercase__					      =		edge
											edges.remove((tail, head, weight)		)
									for edge in edges:
											lowercase__      ,     lowercase__      ,     lowercase__					      =		edge
											lowercase__					      =		union_find.find(_UpperCAmelCase		)
											lowercase__					      =		union_find.find(_UpperCAmelCase		)
											if seta != seta:
													if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
															lowercase__					      =		[head, tail, weight]

													if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
															lowercase__					      =		[head, tail, weight]
									for vertex in cheap_edge:
											if cheap_edge[vertex] != -1:
													lowercase__      ,     lowercase__      ,     lowercase__					      =		cheap_edge[vertex]
													if union_find.find(_UpperCAmelCase		) != union_find.find(_UpperCAmelCase		):
															union_find.union(_UpperCAmelCase				, _UpperCAmelCase		)
															mst_edges.append(cheap_edge[vertex]		)
															lowercase__					      =		num_components - 1
							lowercase__					      =		Graph.build(edges=_UpperCAmelCase		)
							return mst





def 			UpperCamelCase (     __magic_name__					:							str					)       ->  List[str]:  # noqa: E741
		"""simple docstring"""




		lowercase__					      =		len(__magic_name__					)
		lowercase__					      =		0
		lowercase__					      =		[0] * n
		lowercase__					      =		[False] * n
		lowercase__					      =		[False] * n

		def dfs(__magic_name__					:							str   ,   __magic_name__					:							List[str]   ,   __magic_name__					:							str   ,   __magic_name__					:							Any					):
				if parent == root:
						out_edge_count += 1
				lowercase__					      =		True
				lowercase__					      =		at

				for to in l[at]:
						if to == parent:
								pass
						elif not visited[to]:
								lowercase__					      =		dfs(__magic_name__   ,   __magic_name__   ,   __magic_name__   ,   __magic_name__					)
								lowercase__					      =		min(low[at]   ,   low[to]					)

								# AP found via bridge
								if at < low[to]:
										lowercase__					      =		True
								# AP found via cycle
								if at == low[to]:
										lowercase__					      =		True
						else:
								lowercase__					      =		min(low[at]   ,   __magic_name__					)
				return out_edge_count

		for i in range(__magic_name__					):
				if not visited[i]:
						lowercase__					      =		0
						lowercase__					      =		dfs(__magic_name__   ,   __magic_name__   ,   -1   ,   __magic_name__					)
						lowercase__					      =		out_edge_count > 1

		for x in range(len(__magic_name__					)					):
				if is_art[x] is True:
						print(__magic_name__					)


# Adjacency list of graph
A	:		List[str]    =       {
    0: [1, 2],
    1: [0, 2],
    2: [0, 1, 3, 5],
    3: [2, 4],
    4: [3],
    5: [2, 6, 8],
    6: [5, 7],
    7: [6, 8],
    8: [5, 7],
}







compute_ap(data)

