





'''simple docstring'''






import os



def        UpperCamelCase__		(						)				->			Union[str, Any]:
 '''simple docstring'''






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

  snake_case__     :					Optional[int]    =  0

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

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

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

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


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










from string import ascii_uppercase

__A								=       {str(ord(c) - 55): c for c in ascii_uppercase}







def      lowerCamelCase_						(			UpperCamelCase__							: int					,	UpperCamelCase__							: int )	->			str:





				"""simple docstring"""


				if isinstance(UpperCamelCase__					,	UpperCamelCase__ ):
								raise TypeError('int() can\'t convert non-string with explicit base' )
				if num < 0:
								raise ValueError('parameter must be positive int' )
				if isinstance(UpperCamelCase__					,	UpperCamelCase__ ):
								raise TypeError('\'str\' object cannot be interpreted as an integer' )
				if isinstance(UpperCamelCase__					,	UpperCamelCase__ ):
								raise TypeError('\'float\' object cannot be interpreted as an integer' )
				if base in (0, 1):
								raise ValueError('base must be >= 2' )
				if base > 36:
								raise ValueError('base must be <= 36' )
				__lowerCamelCase									=       ''
				__lowerCamelCase									=       0
				__lowerCamelCase									=       0
				while div != 1:
								__lowerCamelCase			,		__lowerCamelCase									=       divmod(UpperCamelCase__					,	UpperCamelCase__ )
								if base >= 11 and 9 < mod < 36:
												__lowerCamelCase									=       ALPHABET_VALUES[str(UpperCamelCase__ )]
								else:
												__lowerCamelCase									=       str(UpperCamelCase__ )
								new_value += actual_value
								__lowerCamelCase									=       num // base
								__lowerCamelCase									=       div
								if div == 0:
												return str(new_value[::-1] )
								elif div == 1:
												new_value += str(UpperCamelCase__ )
												return str(new_value[::-1] )

				return new_value[::-1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					for base in range(2, 37):
										for num in range(10_00):
															assert int(decimal_to_any(num, base), base) == num, (
															    num,
															    base,
															    decimal_to_any(num, base),
															    int(decimal_to_any(num, base), base),
															)


