
'''simple docstring'''



from string import ascii_uppercase

_lowercase    =		{char: i for i, char in enumerate(ascii_uppercase)}
_lowercase    =		dict(enumerate(ascii_uppercase))


def A				(__lowerCamelCase				:str			,     __lowerCamelCase				:str		):
						_lowerCAmelCase  						=			len(__lowerCamelCase		)
						_lowerCAmelCase  						=			0
						while True:
												if x == i:
																		_lowerCAmelCase  						=			0
												if len(__lowerCamelCase		) == len(__lowerCamelCase		):
																		break
												key += key[i]
												i += 1
						return key


def A				(__lowerCamelCase				:str			,     __lowerCamelCase				:str		):
						_lowerCAmelCase  						=			""""""
						_lowerCAmelCase  						=			0
						for letter in message:
												if letter == " ":
																		cipher_text += " "
												else:
																		_lowerCAmelCase  						=			(dicta[letter] - dicta[key_new[i]]) % 26
																		i += 1
																		cipher_text += dicta[x]
						return cipher_text


def A				(__lowerCamelCase				:str			,     __lowerCamelCase				:str		):
						_lowerCAmelCase  						=			""""""
						_lowerCAmelCase  						=			0
						for letter in cipher_text:
												if letter == " ":
																		or_txt += " "
												else:
																		_lowerCAmelCase  						=			(dicta[letter] + dicta[key_new[i]] + 26) % 26
																		i += 1
																		or_txt += dicta[x]
						return or_txt


def A				():
						_lowerCAmelCase  						=			"""THE GERMAN ATTACK"""
						_lowerCAmelCase  						=			"""SECRET"""
						_lowerCAmelCase  						=			generate_key(__lowerCamelCase			,     __lowerCamelCase		)
						_lowerCAmelCase  						=			cipher_text(__lowerCamelCase			,     __lowerCamelCase		)
						print(f'Encrypted Text = {s}'		)
						print(f'Original Text = {original_text(__lowerCamelCase			,     __lowerCamelCase		)}'		)


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()


'''simple docstring'''



import os


def A				():
						with open(os.path.dirname(__lowerCamelCase		) + """/grid.txt"""		) as f:
												_lowerCAmelCase  						=			[]  # noqa: E741
												for _ in range(20		):
																		l.append([int(__lowerCamelCase		) for x in f.readline().split()]		)

												_lowerCAmelCase  						=			0

												# right
												for i in range(20		):
																		for j in range(17		):
																								_lowerCAmelCase  						=			l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
																								if temp > maximum:
																														_lowerCAmelCase  						=			temp

        # down
												for i in range(17		):
																		for j in range(20		):
																								_lowerCAmelCase  						=			l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
																								if temp > maximum:
																														_lowerCAmelCase  						=			temp

        # diagonal 1
												for i in range(17		):
																		for j in range(17		):
																								_lowerCAmelCase  						=			l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
																								if temp > maximum:
																														_lowerCAmelCase  						=			temp

        # diagonal 2
												for i in range(17		):
																		for j in range(3			,     20		):
																								_lowerCAmelCase  						=			l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
																								if temp > maximum:
																														_lowerCAmelCase  						=			temp
												return maximum


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