





import os





def     _UpperCamelCase     ():






				"""simple docstring"""





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

								UpperCamelCase__				     =			0

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

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

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

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


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











def     _UpperCamelCase     (a__   :int       ):






							"""simple docstring"""





							if divisor % 5 == 0 or divisor % 2 == 0:
														return 0
							UpperCamelCase__				     =			1
							UpperCamelCase__				     =			1
							while repunit:
														UpperCamelCase__				     =			(10 * repunit + 1) % divisor
														repunit_index += 1
							return repunit_index





def     _UpperCamelCase     (a__   :int = 100_0000       ):






							"""simple docstring"""





							UpperCamelCase__				     =			limit - 1
							if divisor % 2 == 0:
														divisor += 1
							while least_divisible_repunit(a__       ) <= limit:
														divisor += 2
							return divisor


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




