"""simple docstring"""



from __future__ import annotations

from math import ceil, floor, sqrt



def 					_lowerCamelCase(					a = 2_0_0_0_0_0_0							):
       __a     				=  [0]
       __a     				=  42

       for idx in range(1 ,  ceil(sqrt(target * 2							) * 1.1							)							):
              triangle_numbers.append(triangle_numbers[-1] + idx							)

       # we want this to be as close as possible to target
       __a     				=  0
       # the area corresponding to the grid that gives the product closest to target
       __a     				=  0
       # an estimate of b, using the quadratic formula
       __a     				=  42
       # the largest integer less than b_estimate
       __a     				=  42
       # the largest integer less than b_estimate
       __a     				=  42
       # the triangle number corresponding to b_floor
       __a     				=  42
       # the triangle number corresponding to b_ceil
       __a     				=  42

       for idx_a, triangle_a in enumerate(triangle_numbers[1:] ,  1							):
              __a     				=  (-1 + sqrt(1 + 8 * target / triangle_a							)) / 2
              __a     				=  floor(a							)
              __a     				=  ceil(a							)
              __a     				=  triangle_numbers[b_floor]
              __a     				=  triangle_numbers[b_ceil]

              if abs(target - triangle_b_first_guess * triangle_a							) < abs(
                  target - best_product							):
                     __a     				=  triangle_b_first_guess * triangle_a
                     __a     				=  idx_a * b_floor

              if abs(target - triangle_b_second_guess * triangle_a							) < abs(
                  target - best_product							):
                     __a     				=  triangle_b_second_guess * triangle_a
                     __a     				=  idx_a * b_ceil

       return area


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

"""simple docstring"""



import os



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

              __a     				=  0

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

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

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

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


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