




'''simple docstring'''


def 						SCREAMING_SNAKE_CASE       (      a_	:							list[int]			):
  __a			=					[]
  if len(__a			) == 1:
    return [nums.copy()]
  for _ in range(len(__a			)			):
    __a			=					nums.pop(0			)
    __a			=					permute(__a			)
    for perm in permutations:
      perm.append(__a			)
    result.extend(__a			)
    nums.append(__a			)
  return result


def 						SCREAMING_SNAKE_CASE       (      a_	:							Union[str, Any]			):




  def backtrack(a_	:							Tuple			):
    if start == len(__a			) - 1:
      output.append(nums[:]			)
    else:
      for i in range(__a				,					len(__a			)			):
        __a	,       __a			=					nums[i], nums[start]
        backtrack(start + 1			)
        __a	,       __a			=					nums[i], nums[start]  # backtrack

  __a			=					[]
  backtrack(0			)
  return output


if __name__ == "__main__":
  import doctest

  # use res to print the data in permute2 function
  lowercase_ 		=      permutea([1, 2, 3])
  print(res)
  doctest.testmod()









'''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())



