import os



def 	__SCREAMING_SNAKE_CASE  (					)							->					int:







  """simple docstring"""





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

    SCREAMING_SNAKE_CASE__										=      0

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

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

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

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


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





'''simple docstring'''

def      __lowerCamelCase     (      )			->      Tuple:
		for n in range(1						,			1000000  ):
				yield n * (n + 1) // 2



def      __lowerCamelCase     (      lowerCAmelCase_  )			->      List[Any]:
		_a     :      Any        =							1
		_a     :      Tuple        =							2
		while i * i <= n:
				_a     :      Tuple        =							0
				while n % i == 0:
						n //= i
						multiplicity += 1
				divisors_count *= multiplicity + 1
				i += 1
		if n > 1:
				divisors_count *= 2
		return divisors_count



def      __lowerCamelCase     (      )			->      str:
		return next(i for i in triangle_number_generator() if count_divisors(lowerCAmelCase_  ) > 500  )


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




