





"""simple docstring"""



import os







def 		__lowercase     (   snake_case_  :  int						)   ->Dict:



    '''simple docstring'''







    __A    :						Optional[int]						 =     len(grid[0]						)
    __A    :						Any						 =     len(snake_case_						)

    __A    :						Optional[Any]						 =     0
    __A    :						List[str]						 =     0
    __A    :						int						 =     0

    # Check vertically, horizontally, diagonally at the same time (only works
    # for nxn grid)
    for i in range(snake_case_						):
        for j in range(n_rows - 3						):
            __A    :						List[str]						 =     grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
            __A    :						Tuple						 =     grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3]

            # Left-to-right diagonal (\) product
            if i < n_columns - 3:
                __A    :						Dict						 =     (
                    grid[i][j]
                    * grid[i + 1][j + 1]
                    * grid[i + 2][j + 2]
                    * grid[i + 3][j + 3]
                )

            # Right-to-left diagonal(/) product
            if i > 2:
                __A    :						Dict						 =     (
                    grid[i][j]
                    * grid[i - 1][j + 1]
                    * grid[i - 2][j + 2]
                    * grid[i - 3][j + 3]
                )

            __A    :						Any						 =     max(
                snake_case_				,snake_case_				,snake_case_				,snake_case_						)
            if max_product > largest:
                __A    :						Dict						 =     max_product

    return largest







def 		__lowercase     (   )   ->Optional[Any]:



    '''simple docstring'''







    __A    :						Optional[Any]						 =     []
    with open(os.path.dirname(snake_case_						) + '''/grid.txt'''						) as file:
        for line in file:
            grid.append(line.strip('''\n'''						).split(''' '''						)						)

    __A    :						List[Any]						 =     [[int(snake_case_						) for i in grid[j]] for j in range(len(snake_case_						)						)]

    return largest_product(snake_case_						)


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








def    snake_case_     (  snake_case     )  ->				int:
       if n == 1 or not isinstance(snake_case			,							snake_case     ):
              return 0
       elif n == 2:
              return 1
       else:
              lowercase__:   Optional[Any]  			=   [0, 1]
              for i in range(2			,							n + 1     ):
                     sequence.append(sequence[i - 1] + sequence[i - 2]     )

              return sequence[n]




def    snake_case_     (  snake_case     )  ->				int:
       lowercase__:   int  			=   0
       lowercase__:   int  			=   2

       while digits < n:
              index += 1
              lowercase__:   Tuple  			=   len(str(fibonacci(snake_case     )     )     )

       return index




def    snake_case_     (  snake_case = 10_00     )  ->				int:
       return fibonacci_digits_index(snake_case     )


if __name__ == "__main__":
 print(solution(int(str(input()).strip())))


