"""simple docstring"""



from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
SCREAMING_SNAKE_CASE__:Any			=	299792458

# Symbols
SCREAMING_SNAKE_CASE__	,      SCREAMING_SNAKE_CASE__	,      SCREAMING_SNAKE_CASE__	,      SCREAMING_SNAKE_CASE__:List[str]			=	symbols("""ct x y z""")



def 					_lowerCamelCase(					a							):
       if velocity > c:
              raise ValueError("Speed must not exceed light speed 299,792,458 [m/s]!"							)
       elif velocity < 1:
              # Usually the speed should be much higher than 1 (c order of magnitude)
              raise ValueError("Speed must be greater than or equal to 1!"							)

       return velocity / c



def 					_lowerCamelCase(					a							):
       return 1 / sqrt(1 - beta(a							) ** 2							)



def 					_lowerCamelCase(					a							):
       return np.array(
           [
               [gamma(a							), -gamma(a							) * beta(a							), 0, 0],
               [-gamma(a							) * beta(a							), gamma(a							), 0, 0],
               [0, 0, 1, 0],
               [0, 0, 0, 1],
           ]							)



def 					_lowerCamelCase(					a ,  a = None							):
       # Ensure event is not empty
       if event is None:
              __a     				=  np.array([ct, x, y, z]							)  # Symbolic four vector
       else:
              event[0] *= c  # x0 is ct (speed of light * time)

       return transformation_matrix(a							) @ event


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   # Example of symbolic vector:
   SCREAMING_SNAKE_CASE__:Optional[Any]			=	transform(29979245)
   print("""Example of four vector: """)
   print(F'''ct\' = {four_vector[0]}''')
   print(F'''x\' = {four_vector[1]}''')
   print(F'''y\' = {four_vector[2]}''')
   print(F'''z\' = {four_vector[3]}''')

   # Substitute symbols with numerical values
   SCREAMING_SNAKE_CASE__:Optional[Any]			=	{ct: c, x: 1, y: 1, z: 1}
   SCREAMING_SNAKE_CASE__:Any			=	[four_vector[i].subs(sub_dict) for i in range(4)]

   print(F'''\n{numerical_vector}''')

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