






'''simple docstring'''







from __future__ import annotations
def     A__      (					__lowerCAmelCase		:      tuple[int, int] ,     __lowerCAmelCase		:      int    ):
						lowerCamelCase__							,      lowerCamelCase__								=	position
						lowerCamelCase__								=	[
						    (y + 1, x + 2),
						    (y - 1, x + 2),
						    (y + 1, x - 2),
						    (y - 1, x - 2),
						    (y + 2, x + 1),
						    (y + 2, x - 1),
						    (y - 2, x + 1),
						    (y - 2, x - 1),
						]
						lowerCamelCase__								=	[]

						for position in positions:
												lowerCamelCase__							,      lowerCamelCase__								=	position
												if 0 <= y_test < n and 0 <= x_test < n:
																		permissible_positions.append(__lowerCAmelCase    )

						return permissible_positions
def     A__      (					__lowerCAmelCase		:      list[list[int]]    ):
						return not any(elem == 0 for row in board for elem in row    )
def     A__      (					__lowerCAmelCase		:      list[list[int]] ,     __lowerCAmelCase		:      tuple[int, int] ,     __lowerCAmelCase		:      int    ):

						if is_complete(__lowerCAmelCase    ):
												return True

						for position in get_valid_pos(__lowerCAmelCase ,     len(__lowerCAmelCase    )    ):
												lowerCamelCase__							,      lowerCamelCase__								=	position

												if board[y][x] == 0:
																		lowerCamelCase__								=	curr + 1
																		if open_knight_tour_helper(__lowerCAmelCase ,     __lowerCAmelCase ,     curr + 1    ):
																								return True
																		lowerCamelCase__								=	0

						return False
def     A__      (					__lowerCAmelCase		:      int    ):
						lowerCamelCase__								=	[[0 for i in range(__lowerCAmelCase    )] for j in range(__lowerCAmelCase    )]

						for i in range(__lowerCAmelCase    ):
												for j in range(__lowerCAmelCase    ):
																		lowerCamelCase__								=	1
																		if open_knight_tour_helper(__lowerCAmelCase ,     (i, j) ,     1    ):
																								return board
																		lowerCamelCase__								=	0

						lowerCamelCase__								=	F'''Open Kight Tour cannot be performed on a board of size {n}'''
						raise ValueError(__lowerCAmelCase    )


if __name__ == "__main__":
							import doctest

							doctest.testmod()





'''simple docstring'''





import math






def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: int ):






			"""simple docstring"""




			if not isinstance(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE ):
						__A=	f"""Input value of [number={number}] must be an integer"""
						raise TypeError(_SCREAMING_SNAKE_CASE )

			if number < 1:
						__A=	f"""Input value of [number={number}] must be > 0"""
						raise ValueError(_SCREAMING_SNAKE_CASE )
			elif number == 1:
						return 3
			elif number == 2:
						return 5
			else:
						__A=	int(math.log(number // 3,2 ) ) + 2

						__A=	[3, 5]
						__A=	2
						__A=	3
						for block in range(1,_SCREAMING_SNAKE_CASE ):
									for _ in range(_SCREAMING_SNAKE_CASE ):
												proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1] )
												proth_index += 1
									increment *= 2

			return proth_list[number - 1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					for number in range(1_1):
										UpperCAmelCase__  			=				0
										try:
															UpperCAmelCase__  			=				proth(number)
										except ValueError:
															print(F"""ValueError: there is no {number}th Proth number""")
															continue

										print(F"""The {number}th Proth number: {value}""")



