"""simple docstring"""



def 					_lowerCamelCase(					a							):

       if not isinstance(a ,  a							):
              raise ValueError("multiplicative_persistence() only accepts integral values"							)
       if num < 0:
              raise ValueError("multiplicative_persistence() does not accept negative values"							)

       __a     				=  0
       __a     				=  str(a							)

       while len(a							) != 1:
              __a     				=  [int(a							) for i in num_string]

              __a     				=  1
              for i in range(0 ,  len(a							)							):
                     total *= numbers[i]

              __a     				=  str(a							)

              steps += 1
       return steps



def 					_lowerCamelCase(					a							):

       if not isinstance(a ,  a							):
              raise ValueError("additive_persistence() only accepts integral values"							)
       if num < 0:
              raise ValueError("additive_persistence() does not accept negative values"							)

       __a     				=  0
       __a     				=  str(a							)

       while len(a							) != 1:
              __a     				=  [int(a							) for i in num_string]

              __a     				=  0
              for i in range(0 ,  len(a							)							):
                     total += numbers[i]

              __a     				=  str(a							)

              steps += 1
       return steps


if __name__ == "__main__":
   import doctest

   doctest.testmod()

"""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())
