





import argparse

import torch

from transformers import LxmertConfig, LxmertForPreTraining, load_tf_weights_in_lxmert
from transformers.utils import logging


logging.set_verbosity_info()



def 						A_							(	_lowerCAmelCase				,  _lowerCAmelCase				,  _lowerCAmelCase	)		->					Tuple:
 # Initialise PyTorch model
 UpperCamelCase      :   Any			      =  LxmertConfig.from_json_file(_lowerCAmelCase	)
 print(F"""Building PyTorch model from configuration: {config}"""	)
 UpperCamelCase      :   Union[str, Any]			      =  LxmertForPreTraining(_lowerCAmelCase	)

 # Load weights from tf checkpoint
 load_tf_weights_in_lxmert(_lowerCAmelCase				,  _lowerCAmelCase				,  _lowerCAmelCase	)

 # Save pytorch-model
 print(F"""Save PyTorch model to {pytorch_dump_path}"""	)
 torch.save(model.state_dict()				,  _lowerCAmelCase	)


if __name__ == "__main__":
    __lowerCamelCase			:	Any					    =	argparse.ArgumentParser()
    # Required parameters
    parser.add_argument(
        """--tf_checkpoint_path""", default=None, type=str, required=True, help="""Path to the TensorFlow checkpoint path."""
    )
    parser.add_argument(
        """--config_file""",
        default=None,
        type=str,
        required=True,
        help="""The config json file corresponding to the pre-trained model. \nThis specifies the model architecture.""",
    )
    parser.add_argument(
        """--pytorch_dump_path""", default=None, type=str, required=True, help="""Path to the output PyTorch model."""
    )
    __lowerCamelCase			:	Tuple					    =	parser.parse_args()
    convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.config_file, args.pytorch_dump_path)







import os



def 						A_							(	)		->					Union[str, Any]:
 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      :   str			      =  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      :   List[Any]			      =  temp

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

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

        # diagonal 2
  for i in range(17	):
   for j in range(3				,  20	):
    UpperCamelCase      :   Tuple			      =  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
  return maximum


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