
'''simple docstring'''







from __future__ import annotations

from queue import Queue

def 				_snake_case (		lowercase			,    lowercase						)       ->       tuple[int, int]:
				a ^= b
				b ^= a
				a ^= b
				return a, b

def 				_snake_case (		lowercase			,    lowercase						)       ->       list[list[int]]:
				__a       :     Optional[int]								=	1
				while (1 << j) < max_node:
								for i in range(1			,    max_node + 1						):
												__a       :     List[Any]								=	parent[j - 1][parent[j - 1][i]]
								j += 1
				return parent

def 				_snake_case (		lowercase			,    lowercase			,    lowercase			,    lowercase						)       ->       int:
				# u must be deeper in the tree than v
				if level[u] < level[v]:
								__a							,	__a       :     Any								=	swap(lowercase			,    lowercase						)
				# making depth of u same as depth of v
				for i in range(1_8			,    -1			,    -1						):
								if level[u] - (1 << i) >= level[v]:
												__a       :     str								=	parent[i][u]
    # at the same depth if u==v that mean lca is found
				if u == v:
								return u
				# moving both nodes upwards till lca in found
				for i in range(1_8			,    -1			,    -1						):
								if parent[i][u] not in [0, parent[i][v]]:
												__a							,	__a       :     Any								=	parent[i][u], parent[i][v]
    # returning longest common ancestor of u,v
				return parent[0][u]

def 				_snake_case (		lowercase			,    lowercase			,    lowercase			,    lowercase			,    lowercase = 1			,    )       ->       tuple[list[int], list[list[int]]]:
				__a       :     Optional[Any]								=	0
				__a       :     Queue[int]								=	Queue(maxsize=lowercase						)
				q.put(lowercase						)
				while q.qsize() != 0:
								__a       :     Optional[int]								=	q.get()
								for v in graph[u]:
												if level[v] == -1:
																__a       :     Tuple								=	level[u] + 1
																q.put(lowercase						)
																__a       :     Union[str, Any]								=	u
				return level, parent

def 				_snake_case (		)       ->       None:
				__a       :     List[str]								=	1_3
				# initializing with 0
				__a       :     int								=	[[0 for _ in range(max_node + 1_0						)] for _ in range(2_0						)]
				# initializing with -1 which means every node is unvisited
				__a       :     int								=	[-1 for _ in range(max_node + 1_0						)]
				__a       :     dict[int, list[int]]								=	{
				    1: [2, 3, 4],
				    2: [5],
				    3: [6, 7],
				    4: [8],
				    5: [9, 1_0],
				    6: [1_1],
				    7: [],
				    8: [1_2, 1_3],
				    9: [],
				    1_0: [],
				    1_1: [],
				    1_2: [],
				    1_3: [],
				}
				__a							,	__a       :     Optional[Any]								=	breadth_first_search(lowercase			,    lowercase			,    lowercase			,    lowercase			,    1						)
				__a       :     Optional[Any]								=	create_sparse(lowercase			,    lowercase						)
				print("""LCA of node 1 and 3 is: """			,    lowest_common_ancestor(1			,    3			,    lowercase			,    lowercase						)						)
				print("""LCA of node 5 and 6 is: """			,    lowest_common_ancestor(5			,    6			,    lowercase			,    lowercase						)						)
				print("""LCA of node 7 and 11 is: """			,    lowest_common_ancestor(7			,    1_1			,    lowercase			,    lowercase						)						)
				print("""LCA of node 6 and 7 is: """			,    lowest_common_ancestor(6			,    7			,    lowercase			,    lowercase						)						)
				print("""LCA of node 4 and 12 is: """			,    lowest_common_ancestor(4			,    1_2			,    lowercase			,    lowercase						)						)
				print("""LCA of node 8 and 8 is: """			,    lowest_common_ancestor(8			,    8			,    lowercase			,    lowercase						)						)


if __name__ == "__main__":
					main()

'''simple docstring'''







def 				_snake_case (		lowercase = 2_0						)       ->       int:

				try:
								__a       :     Optional[Any]								=	int(lowercase						)
				except (TypeError, ValueError):
								raise TypeError("""Parameter n must be int or castable to int."""						)
				if n <= 0:
								raise ValueError("""Parameter n must be greater than or equal to one."""						)
				__a       :     List[Any]								=	0
				while 1:
								i += n * (n - 1)
								__a       :     Union[str, Any]								=	0
								for j in range(2			,    lowercase						):
												if i % j != 0:
																__a       :     Any								=	1
																break
								if nfound == 0:
												if i == 0:
																__a       :     List[str]								=	1
												return i
				return None


if __name__ == "__main__":
					print(f'''{solution() = }''')