

'''simple docstring'''





def   a   (    A__			:     list[int]   ,     A__			:     list[int]  )					->   tuple[float, float]:





      """simple docstring"""



      if not len(UpperCAmelCase__  ) == len(UpperCAmelCase__  ) == 3:
            raise ValueError('Please enter a valid equation.'  )
      if equationa[0] == equationa[1] == equationa[0] == equationa[1] == 0:
            raise ValueError('Both a & b of two equations can\'t be zero.'  )

      # Extract the coefficients
      _lowercase			 =equationa
      _lowercase			 =equationa

      # Calculate the determinants of the matrices
      _lowercase			 =aa * ba - aa * ba
      _lowercase			 =ca * ba - ca * ba
      _lowercase			 =aa * ca - aa * ca

      # Check if the system of linear equations has a solution (using Cramer's rule)
      if determinant == 0:
            if determinant_x == determinant_y == 0:
                  raise ValueError('Infinite solutions. (Consistent system)'  )
            else:
                  raise ValueError('No solution. (Inconsistent system)'  )
      else:
            if determinant_x == determinant_y == 0:
                  # Trivial solution (Inconsistent system)
                  return (0.0, 0.0)
            else:
                  _lowercase			 =determinant_x / determinant
                  _lowercase			 =determinant_y / determinant
                  # Non-Trivial Solution (Consistent system)
                  return (x, y)





import os
def   a   (    )					->   Optional[int]:





      """simple docstring"""



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

            _lowercase			 =0

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

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

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

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


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


