






import os


def 	lowerCamelCase__      (  ):

  """simple docstring"""






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

    SCREAMING_SNAKE_CASE							:   str						    =     0

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

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

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

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


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










def 	__lowerCamelCase						(							lowerCamelCase__		:						int      ):





			'''simple docstring'''




			lowerCamelCase    		=  (1 + 24 * n) ** 0.5
			return ((1 + root) / 6) % 1 == 0






def 	__lowerCamelCase						(							lowerCamelCase__		:						int = 5000      ):





			'''simple docstring'''




			lowerCamelCase    		=  [(i * (3 * i - 1)) // 2 for i in range(1  ,							lowerCamelCase__      )]
			for i, pentagonal_i in enumerate(lowerCamelCase__      ):
						for j in range(lowerCamelCase__  ,							len(lowerCamelCase__      )      ):
									lowerCamelCase    		=  pentagonal_nums[j]
									lowerCamelCase    		=  pentagonal_i + pentagonal_j
									lowerCamelCase    		=  pentagonal_j - pentagonal_i
									if is_pentagonal(lowerCamelCase__      ) and is_pentagonal(lowerCamelCase__      ):
												return b

			return -1


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

