






import os

def   __lowercase       (			):







				"""simple docstring"""






				with open(os.path.dirname(snake_case			) + '''/grid.txt'''			) as f:
								__magic_name__		:int   =   []  # noqa: E741
								for _ in range(2_0			):
												l.append([int(snake_case			) for x in f.readline().split()]			)

								__magic_name__		:Union[str, Any]   =   0

								# right
								for i in range(2_0			):
												for j in range(1_7			):
																__magic_name__		:Any   =   l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
																if temp > maximum:
																				__magic_name__		:Optional[Any]   =   temp

        # down
								for i in range(1_7			):
												for j in range(2_0			):
																__magic_name__		:Optional[Any]   =   l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
																if temp > maximum:
																				__magic_name__		:Optional[int]   =   temp

        # diagonal 1
								for i in range(1_7			):
												for j in range(1_7			):
																__magic_name__		:int   =   l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
																if temp > maximum:
																				__magic_name__		:Optional[Any]   =   temp

        # diagonal 2
								for i in range(1_7			):
												for j in range(3,	2_0			):
																__magic_name__		:int   =   l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
																if temp > maximum:
																				__magic_name__		:List[str]   =   temp
								return maximum


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










'''simple docstring'''
def 					lowerCamelCase_ ( __UpperCamelCase					:       int		)					->	bool:







     """simple docstring"""
     if num < 0:
          return False

     _A				=							num
     _A				=							0
     while num > 0:
          _A				=							rev_num * 1_0 + (num % 1_0)
          num //= 1_0

     return num_copy == rev_num


if __name__ == "__main__":
    import doctest

    doctest.testmod()





