



"""simple docstring"""

from __future__ import annotations

lowercase__			   =  [True] * 1000001
lowercase__			   =  2
while i * i <= 1000000:
	if seive[i]:
		for j in range(i * i, 1000001, i):
			lowercase__			   =  False
	i += 1





def       __magic_name__    (   _lowerCamelCase				: int					):
							return seive[n]





def       __magic_name__    (   _lowerCamelCase				: int					):
							return any(digit in """02468""" for digit in str(_lowerCamelCase					)					)





def       __magic_name__    (   _lowerCamelCase				: int = 1_0_0_0_0_0_0					):
							__a		:		str									=       [2]  # result already includes the number 2.
							for num in range(3  ,       limit + 1  ,       2					):
														if is_prime(_lowerCamelCase					) and not contains_an_even_digit(_lowerCamelCase					):
																					__a		:		str									=       str(_lowerCamelCase					)
																					__a		:		str									=       [int(str_num[j:] + str_num[:j]					) for j in range(len(_lowerCamelCase					)					)]
																					if all(is_prime(_lowerCamelCase					) for i in list_nums					):
																												result.append(_lowerCamelCase					)
							return result





def       __magic_name__    (   ):
							return len(find_circular_primes()					)


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






"""simple docstring"""

import os





def       __magic_name__    (   _lowerCamelCase				: Dict					):
							__a		:		List[str]									=       len(grid[0]					)
							__a		:		int									=       len(_lowerCamelCase					)

							__a		:		Tuple									=       0
							__a		:		List[Any]									=       0
							__a		:		List[str]									=       0

							# Check vertically, horizontally, diagonally at the same time (only works
							# for nxn grid)
							for i in range(_lowerCamelCase					):
														for j in range(n_rows - 3					):
																					__a		:		List[Any]									=       grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
																					__a		:		Tuple									=       grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3]

																					# Left-to-right diagonal (\) product
																					if i < n_columns - 3:
																												__a		:		List[Any]									=       (
																												    grid[i][j]
																												    * grid[i + 1][j + 1]
																												    * grid[i + 2][j + 2]
																												    * grid[i + 3][j + 3]
																												)

																					# Right-to-left diagonal(/) product
																					if i > 2:
																												__a		:		List[Any]									=       (
																												    grid[i][j]
																												    * grid[i - 1][j + 1]
																												    * grid[i - 2][j + 2]
																												    * grid[i - 3][j + 3]
																												)

																					__a		:		str									=       max(
																					    _lowerCamelCase  ,       _lowerCamelCase  ,       _lowerCamelCase  ,       _lowerCamelCase					)
																					if max_product > largest:
																												__a		:		Optional[Any]									=       max_product

							return largest





def       __magic_name__    (   ):
							__a		:		Tuple									=       []
							with open(os.path.dirname(_lowerCamelCase					) + """/grid.txt"""					) as file:
														for line in file:
																					grid.append(line.strip("""\n"""					).split(""" """					)					)

							__a		:		Tuple									=       [[int(_lowerCamelCase					) for i in grid[j]] for j in range(len(_lowerCamelCase					)					)]

							return largest_product(_lowerCamelCase					)


if __name__ == "__main__":
	print(solution())

