



"""simple docstring"""


from collections import deque

def  _lowerCAmelCase      (   lowercase_						):
						UpperCAmelCase             = len(lowercase_						)
						UpperCAmelCase             = deque()
						UpperCAmelCase             = [False for _ in range(lowercase_						)]
						UpperCAmelCase             = [-1 for _ in range(lowercase_						)]
						UpperCAmelCase             = index_of[:]

						def strong_connect(lowercase_		,	lowercase_		,	lowercase_						):
												UpperCAmelCase             = index  # the number when this node is seen
												UpperCAmelCase             = index  # lowest rank node reachable from here
												index += 1
												stack.append(lowercase_						)
												UpperCAmelCase             = True

												for w in g[v]:
																		if index_of[w] == -1:
																								UpperCAmelCase             = strong_connect(lowercase_		,	lowercase_		,	lowercase_						)
																								UpperCAmelCase             = (
																								    lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
																								)
																		elif on_stack[w]:
																								UpperCAmelCase             = (
																								    lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
																								)

												if lowlink_of[v] == index_of[v]:
																		UpperCAmelCase             = []
																		UpperCAmelCase             = stack.pop()
																		UpperCAmelCase             = False
																		component.append(lowercase_						)
																		while w != v:
																								UpperCAmelCase             = stack.pop()
																								UpperCAmelCase             = False
																								component.append(lowercase_						)
																		components.append(lowercase_						)
												return index

						UpperCAmelCase             = []
						for v in range(lowercase_						):
												if index_of[v] == -1:
																		strong_connect(lowercase_		,	0		,	lowercase_						)

						return components

def  _lowerCAmelCase      (   lowercase_		,	lowercase_						):
						UpperCAmelCase             = [[] for _ in range(lowercase_						)]
						for u, v in edges:
												g[u].append(lowercase_						)
						return g


if __name__ == "__main__":
				# Test
				snake_case_				     =       7
				snake_case_				     =       [0, 0, 1, 2, 3, 3, 4, 4, 6]
				snake_case_				     =       [1, 3, 2, 0, 1, 4, 5, 6, 5]
				snake_case_				     =       [(u, v) for u, v in zip(source, target)]
				snake_case_				     =       create_graph(n_vertices, edges)

				assert [[5], [6], [4], [3, 2, 1, 0]] == tarjan(g)









"""simple docstring"""






import re
def      lowerCamelCase       (     _UpperCamelCase		:      str							)		->       str:

							'''simple docstring'''



							if len(re.findall("""[ATCG]"""       ,			_UpperCamelCase							)							) != len(_UpperCamelCase							):
														raise ValueError("""Invalid Strand"""							)

							return dna.translate(dna.maketrans("""ATCG"""       ,			"""TAGC"""							)							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
