




'''simple docstring'''


import os
from argparse import ArgumentParser
from typing import List

import torch.utils.data

from datasets import Dataset, IterableDataset
from datasets.distributed import split_dataset_by_node


UpperCAmelCase_ 		=      4
UpperCAmelCase_ 		=      3





class    __lowercase						(  __magic_name__ ):
   pass


def 						SCREAMING_SNAKE_CASE       (      a_	:							List[str]			):
  for shard in shards:
    for i in range(a_			):
      yield {"i": i, "shard": shard}


def 						SCREAMING_SNAKE_CASE       (      ):
  __a			=					int(os.environ['RANK']			)
  __a			=					int(os.environ['WORLD_SIZE']			)

  __a			=					ArgumentParser()
  parser.add_argument('--streaming'				,					type=a_			)
  parser.add_argument('--local_rank'				,					type=a_			)
  parser.add_argument('--num_workers'				,					type=a_				,					default=0			)
  __a			=					parser.parse_args()
  __a			=					args.streaming
  __a			=					args.num_workers

  __a			=					{'shards': [f"shard_{shard_idx}" for shard_idx in range(a_			)]}
  __a			=					IterableDataset.from_generator(a_				,					gen_kwargs=a_			)
  if not streaming:
    __a			=					Dataset.from_list(list(a_			)			)

  __a			=					split_dataset_by_node(a_				,					rank=a_				,					world_size=a_			)
  __a			=					torch.utils.data.DataLoader(a_				,					num_workers=a_			)

  __a			=					NUM_SHARDS * NUM_ITEMS_PER_SHARD
  __a			=					full_size // world_size
  expected_local_size += int(rank < (full_size % world_size)			)

  __a			=					sum(1 for _ in dataloader			)
  if local_size != expected_local_size:
    raise FailedTestError(f"local_size {local_size} != expected_local_size {expected_local_size}"			)


if __name__ == "__main__":
  main()









'''simple docstring'''


import os


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

    __a			=					0

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

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

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

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


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



