


"""simple docstring"""


import unittest

from knapsack import knapsack as k


class 			A__	(						unittest.TestCase):


     """simple docstring"""

     def 		a__						(	self:						List[str]	)->    str:
           lowerCamelCase					:					Dict        =	0
           lowerCamelCase					:					str        =	[0]
           lowerCamelCase					:					Union[str, Any]        =	[0]
           lowerCamelCase					:					Tuple        =	len(__a	)
           self.assertEqual(k.knapsack(__a     ,		__a     ,		__a     ,		__a	)     ,		0	)

           lowerCamelCase					:					str        =	[60]
           lowerCamelCase					:					str        =	[10]
           lowerCamelCase					:					str        =	len(__a	)
           self.assertEqual(k.knapsack(__a     ,		__a     ,		__a     ,		__a	)     ,		0	)

     def 		a__						(	self:						List[Any]	)->    int:
           lowerCamelCase					:					str        =	3
           lowerCamelCase					:					List[str]        =	[1, 2, 3]
           lowerCamelCase					:					List[Any]        =	[3, 2, 1]
           lowerCamelCase					:					Tuple        =	len(__a	)
           self.assertEqual(k.knapsack(__a     ,		__a     ,		__a     ,		__a	)     ,		5	)







     def 		a__						(	self:						int	)->    str:
           lowerCamelCase					:					List[Any]        =	50
           lowerCamelCase					:					Tuple        =	[60, 100, 120]
           lowerCamelCase					:					Optional[Any]        =	[10, 20, 30]
           lowerCamelCase					:					List[str]        =	len(__a	)
           self.assertEqual(k.knapsack(__a     ,		__a     ,		__a     ,		__a	)     ,		220	)


if __name__ == "__main__":
    unittest.main()








"""simple docstring"""


import os




def   snake_case		(     )   ->      Optional[Any]:
      with open(os.path.dirname(UpperCamelCase__    ) + """/grid.txt"""    ) as f:
            lowerCamelCase					:					int        =	[]  # noqa: E741
            for _ in range(20    ):
                  l.append([int(UpperCamelCase__    ) for x in f.readline().split()]    )

            lowerCamelCase					:					Union[str, Any]        =	0

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

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

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

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


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




