
"""simple docstring"""


import os



def 	lowerCamelCase__			(							UpperCAmelCase_				)->							str:







       """simple docstring"""
       UpperCamelCase					 =		len(grid[0]				)
       UpperCamelCase					 =		len(UpperCAmelCase_				)

       UpperCamelCase					 =		0
       UpperCamelCase					 =		0
       UpperCamelCase					 =		0

       # Check vertically, horizontally, diagonally at the same time (only works
       # for nxn grid)
       for i in range(UpperCAmelCase_				):
              for j in range(n_rows - 3				):
                     UpperCamelCase					 =		grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
                     UpperCamelCase					 =		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:
                            UpperCamelCase					 =		(
                                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:
                            UpperCamelCase					 =		(
                                grid[i][j]
                                * grid[i - 1][j + 1]
                                * grid[i - 2][j + 2]
                                * grid[i - 3][j + 3]
                            )

                     UpperCamelCase					 =		max(
                         UpperCAmelCase_		,      UpperCAmelCase_		,      UpperCAmelCase_		,      UpperCAmelCase_				)
                     if max_product > largest:
                            UpperCamelCase					 =		max_product

       return largest



def 	lowerCamelCase__			(							)->							List[str]:







       """simple docstring"""
       UpperCamelCase					 =		[]
       with open(os.path.dirname(UpperCAmelCase_				) + "/grid.txt"				) as file:
              for line in file:
                     grid.append(line.strip("\n"				).split(" "				)				)

       UpperCamelCase					 =		[[int(UpperCAmelCase_				) for i in grid[j]] for j in range(len(UpperCAmelCase_				)				)]

       return largest_product(UpperCAmelCase_				)


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







"""simple docstring"""


def 	lowerCamelCase__			(							UpperCAmelCase_ = 4_00_00_00				)->							int:







       """simple docstring"""
       UpperCamelCase					 =		[0, 1]
       UpperCamelCase					 =		0
       while fib[i] <= n:
              fib.append(fib[i] + fib[i + 1]				)
              if fib[i + 2] > n:
                     break
              i += 1
       UpperCamelCase					 =		0
       for j in range(len(UpperCAmelCase_				) - 1				):
              if fib[j] % 2 == 0:
                     total += fib[j]

       return total


if __name__ == "__main__":
      print(F'''{solution() = }''')





