





import os



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

  UpperCamelCase	:					Optional[Any]       	=   0

  # right
  for i in range(20     ):
   for j in range(17     ):
    UpperCamelCase	:					int       	=   l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
    if temp > maximum:
     UpperCamelCase	:					Union[str, Any]       	=   temp

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

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

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


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







class 					A__   :





      def __init__( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Union[str, Any]       	=   set_counts
       UpperCamelCase	:					int       	=   max(A_   )
       UpperCamelCase	:					Optional[Any]       	=   len(A_   )
       UpperCamelCase	:					Union[str, Any]       	=   [1] * num_sets
       UpperCamelCase	:					Union[str, Any]       	=   list(range(A_   )   )





      def        __UpperCamelCase( self       ,							A_       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Any       	=   self.get_parent(A_   )
       UpperCamelCase	:					Optional[int]       	=   self.get_parent(A_   )

       if src_parent == dst_parent:
        return False

       if self.ranks[dst_parent] >= self.ranks[src_parent]:
        self.set_counts[dst_parent] += self.set_counts[src_parent]
        UpperCamelCase	:					int       	=   0
        UpperCamelCase	:					Dict       	=   dst_parent
        if self.ranks[dst_parent] == self.ranks[src_parent]:
         self.ranks[dst_parent] += 1
        UpperCamelCase	:					Optional[int]       	=   self.set_counts[dst_parent]
       else:
        self.set_counts[src_parent] += self.set_counts[dst_parent]
        UpperCamelCase	:					Any       	=   0
        UpperCamelCase	:					Optional[int]       	=   src_parent
        UpperCamelCase	:					int       	=   self.set_counts[src_parent]

       UpperCamelCase	:					Any       	=   max(self.max_set       ,							A_   )
       return True





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if self.parents[disj_set] == disj_set:
        return disj_set
       UpperCamelCase	:					Optional[int]       	=   self.get_parent(self.parents[disj_set]   )
       return self.parents[disj_set]
