
'''simple docstring'''



import os


def A (__lowerCamelCase :Dict						):
						_lowerCAmelCase    		=					len(grid[0]						)
						_lowerCAmelCase    		=					len(__lowerCamelCase						)

						_lowerCAmelCase    		=					0
						_lowerCAmelCase    		=					0
						_lowerCAmelCase    		=					0

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

																		_lowerCAmelCase    		=					max(
																		    __lowerCamelCase					,      __lowerCamelCase					,      __lowerCamelCase					,      __lowerCamelCase						)
																		if max_product > largest:
																								_lowerCAmelCase    		=					max_product

						return largest


def A ():
						_lowerCAmelCase    		=					[]
						with open(os.path.dirname(__lowerCamelCase						) + """/grid.txt"""						) as file:
												for line in file:
																		grid.append(line.strip("""\n"""						).split(""" """						)						)

						_lowerCAmelCase    		=					[[int(__lowerCamelCase						) for i in grid[j]] for j in range(len(__lowerCamelCase						)						)]

						return largest_product(__lowerCamelCase						)


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


'''simple docstring'''



from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowercase          =						logging.get_logger(__name__)

_lowercase          =						{
    """edbeeching/decision-transformer-gym-hopper-medium""": (
        """https://huggingface.co/edbeeching/decision-transformer-gym-hopper-medium/resolve/main/config.json"""
    ),
    # See all DecisionTransformer models at https://huggingface.co/models?filter=decision_transformer
}




class     UpperCAmelCase_	(						_SCREAMING_SNAKE_CASE					):






						'''simple docstring'''






						_lowercase						: List[str]										=  '''decision_transformer'''
						_lowercase						: Optional[Any]										=  ['''past_key_values''']
						_lowercase						: str										=  {
						    '''max_position_embeddings''': '''n_positions''',
						    '''num_attention_heads''': '''n_head''',
						    '''num_hidden_layers''': '''n_layer''',
						}




						def __init__(   self       ,  _lowercase=17       ,  _lowercase=4       ,  _lowercase=128       ,  _lowercase=4_096       ,  _lowercase=True       ,  _lowercase=1       ,  _lowercase=1_024       ,  _lowercase=3       ,  _lowercase=1       ,  _lowercase=None       ,  _lowercase="relu"       ,  _lowercase=0.1       ,  _lowercase=0.1       ,  _lowercase=0.1       ,  _lowercase=1e-5       ,  _lowercase=0.02       ,  _lowercase=True       ,  _lowercase=True       ,  _lowercase=50_256       ,  _lowercase=50_256       ,  _lowercase=False       ,  _lowercase=False       ,  **_lowercase       ,  ):

												"""simple docstring"""



												_lowerCAmelCase    		=					state_dim
												_lowerCAmelCase    		=					act_dim
												_lowerCAmelCase    		=					hidden_size
												_lowerCAmelCase    		=					max_ep_len
												_lowerCAmelCase    		=					action_tanh
												_lowerCAmelCase    		=					vocab_size
												_lowerCAmelCase    		=					n_positions
												_lowerCAmelCase    		=					n_layer
												_lowerCAmelCase    		=					n_head
												_lowerCAmelCase    		=					n_inner
												_lowerCAmelCase    		=					activation_function
												_lowerCAmelCase    		=					resid_pdrop
												_lowerCAmelCase    		=					embd_pdrop
												_lowerCAmelCase    		=					attn_pdrop
												_lowerCAmelCase    		=					layer_norm_epsilon
												_lowerCAmelCase    		=					initializer_range
												_lowerCAmelCase    		=					scale_attn_weights
												_lowerCAmelCase    		=					use_cache
												_lowerCAmelCase    		=					scale_attn_by_inverse_layer_idx
												_lowerCAmelCase    		=					reorder_and_upcast_attn

												_lowerCAmelCase    		=					bos_token_id
												_lowerCAmelCase    		=					eos_token_id

												super().__init__(bos_token_id=_lowercase       ,  eos_token_id=_lowercase       ,  **_lowercase )
