


"""simple docstring"""


import doctest
from collections import deque

import numpy as np


class 			A__	:


     """simple docstring"""

     def __init__(	self:						Tuple	)->    None:
           lowerCamelCase					:					Dict        =	[2, 1, 2, -1]
           lowerCamelCase					:					str        =	[1, 2, 3, 4]







     def 		a__						(	self:						Any	)->    list[float]:
           lowerCamelCase					:					List[Any]        =	len(self.first_signal	)
           lowerCamelCase					:					Union[str, Any]        =	len(self.second_signal	)

           lowerCamelCase					:					Union[str, Any]        =	max(__a     ,		__a	)

           # create a zero matrix of max_length x max_length
           lowerCamelCase					:					List[str]        =	[[0] * max_length for i in range(__a	)]

           # fills the smaller signal with zeros to make both signals of same length
           if length_first_signal < length_second_signal:
                 self.first_signal += [0] * (max_length - length_first_signal)
           elif length_first_signal > length_second_signal:
                 self.second_signal += [0] * (max_length - length_second_signal)
           for i in range(__a	):
                 lowerCamelCase					:					Any        =	deque(self.second_signal	)
                 rotated_signal.rotate(__a	)
                 for j, item in enumerate(__a	):
                       matrix[i][j] += item

        # multiply the matrix with the first signal
           lowerCamelCase					:					Tuple        =	np.matmul(np.transpose(__a	)     ,		np.transpose(self.first_signal	)	)

           # rounding-off to two decimal places
           return [round(__a     ,		2	) for i in final_signal]


if __name__ == "__main__":
    doctest.testmod()








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




