


import os







def 						lowerCamelCase(   ):
				with open(os.path.dirname(a__) + '''/grid.txt''') as f:
								_SCREAMING_SNAKE_CASE			  =[]  # noqa: E741
								for _ in range(20):
												l.append([int(a__) for x in f.readline().split()])

								_SCREAMING_SNAKE_CASE			  =0

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

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

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

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


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



from datetime import datetime

import matplotlib.pyplot as plt
import torch







def 						lowerCamelCase(   a__):
				for param in module.parameters():
								_SCREAMING_SNAKE_CASE			  =False







def 						lowerCamelCase(   ):
				_SCREAMING_SNAKE_CASE			  ='''cuda''' if torch.cuda.is_available() else '''cpu'''
				if torch.backends.mps.is_available() and torch.backends.mps.is_built():
								_SCREAMING_SNAKE_CASE			  ='''mps'''
				if device == "mps":
								print(
								    '''WARNING: MPS currently doesn\'t seem to work, and messes up backpropagation without any visible torch'''
								    ''' errors. I recommend using CUDA on a colab notebook or CPU instead if you\'re facing inexplicable issues'''
								    ''' with generations.''')
				return device







def 						lowerCamelCase(   a__):
				_SCREAMING_SNAKE_CASE			  =plt.imshow(a__)
				fig.axes.get_xaxis().set_visible(a__)
				fig.axes.get_yaxis().set_visible(a__)
				plt.show()







def 						lowerCamelCase(   ):
				_SCREAMING_SNAKE_CASE			  =datetime.now()
				_SCREAMING_SNAKE_CASE			  =current_time.strftime('''%H:%M:%S''')
				return timestamp