

import itertools
import string
from collections.abc import Generator, Iterable
def 							__SCREAMING_SNAKE_CASE     (   a__    :   Iterable[str]			,a__    :   int       )					->				Generator[tuple[str, ...], None, None]:
	__A :			Union[str, Any]		    =			iter(a__       )
	while True:
		__A :			Union[str, Any]		    =			tuple(itertools.islice(a__			,a__       )       )
		if not chunk:
			return
		yield chunk
def 							__SCREAMING_SNAKE_CASE     (   a__    :   str       )					->				str:
	__A :			List[Any]		    =			"""""".join([c.upper() for c in dirty if c in string.ascii_letters]       )
	__A :			Union[str, Any]		    =			""""""

	if len(a__       ) < 2:
		return dirty

	for i in range(len(a__       ) - 1       ):
		clean += dirty[i]

		if dirty[i] == dirty[i + 1]:
			clean += "X"

	clean += dirty[-1]

	if len(a__       ) & 1:
		clean += "X"

	return clean
def 							__SCREAMING_SNAKE_CASE     (   a__    :   str       )					->				list[str]:
	# I and J are used interchangeably to allow
	# us to use a 5x5 table (25 letters)
	__A :			Dict		    =			"""ABCDEFGHIKLMNOPQRSTUVWXYZ"""
	# we're using a list instead of a '2d' array because it makes the math
	# for setting up the table and doing the actual encoding/decoding simpler
	__A :			Dict		    =			[]

	# copy key chars into the table if they are in `alphabet` ignoring duplicates
	for char in key.upper():
		if char not in table and char in alphabet:
			table.append(a__       )

    # fill the rest of the table in with the remaining alphabet chars
	for char in alphabet:
		if char not in table:
			table.append(a__       )

	return table
def 							__SCREAMING_SNAKE_CASE     (   a__    :   str			,a__    :   str       )					->				str:
	__A :			Optional[int]		    =			generate_table(a__       )
	__A :			str		    =			prepare_input(a__       )
	__A :			Tuple		    =			""""""

	# https://en.wikipedia.org/wiki/Playfair_cipher#Description
	for chara, chara in chunker(a__			,2       ):
		__A    ,				__A :			int		    =			divmod(table.index(a__       )			,5       )
		__A    ,				__A :			Union[str, Any]		    =			divmod(table.index(a__       )			,5       )

		if rowa == rowa:
			ciphertext += table[rowa * 5 + (cola + 1) % 5]
			ciphertext += table[rowa * 5 + (cola + 1) % 5]
		elif cola == cola:
			ciphertext += table[((rowa + 1) % 5) * 5 + cola]
			ciphertext += table[((rowa + 1) % 5) * 5 + cola]
		else:  # rectangle
			ciphertext += table[rowa * 5 + cola]
			ciphertext += table[rowa * 5 + cola]

	return ciphertext







def 							__SCREAMING_SNAKE_CASE     (   a__    :   str			,a__    :   str       )					->				str:
	__A :			Optional[int]		    =			generate_table(a__       )
	__A :			List[str]		    =			""""""

	# https://en.wikipedia.org/wiki/Playfair_cipher#Description
	for chara, chara in chunker(a__			,2       ):
		__A    ,				__A :			List[Any]		    =			divmod(table.index(a__       )			,5       )
		__A    ,				__A :			Tuple		    =			divmod(table.index(a__       )			,5       )

		if rowa == rowa:
			plaintext += table[rowa * 5 + (cola - 1) % 5]
			plaintext += table[rowa * 5 + (cola - 1) % 5]
		elif cola == cola:
			plaintext += table[((rowa - 1) % 5) * 5 + cola]
			plaintext += table[((rowa - 1) % 5) * 5 + cola]
		else:  # rectangle
			plaintext += table[rowa * 5 + cola]
			plaintext += table[rowa * 5 + cola]

	return plaintext








from math import sqrt
def 							__SCREAMING_SNAKE_CASE     (   a__    :   int = 1000000       )					->				int:
	__A :			int		    =			0
	__A :			int		    =			0
	__A :			int

	while num_cuboids <= limit:
		max_cuboid_size += 1
		for sum_shortest_sides in range(2			,2 * max_cuboid_size + 1       ):
			if sqrt(sum_shortest_sides**2 + max_cuboid_size**2       ).is_integer():
				num_cuboids += (
				    min(a__			,sum_shortest_sides // 2       )
				    - max(1			,sum_shortest_sides - max_cuboid_size       )
				    + 1
				)

	return max_cuboid_size


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





