

from __future__ import annotations
def   a   (    A__			:     list[int]   ,     A__			:     int   ,     A__			:     int   ,     A__			:     int  )					->   None:





      """simple docstring"""



      if (direction == 1 and array[indexa] > array[indexa]) or (
          direction == 0 and array[indexa] < array[indexa]
      ):
            _lowercase , _lowercase			 =array[indexa], array[indexa]
def   a   (    A__			:     list[int]   ,     A__			:     int   ,     A__			:     int   ,     A__			:     int  )					->   None:





      """simple docstring"""



      if length > 1:
            _lowercase			 =int(length / 2  )
            for i in range(A__   ,     low + middle  ):
                  comp_and_swap(A__   ,     A__   ,     i + middle   ,     A__  )
            bitonic_merge(A__   ,     A__   ,     A__   ,     A__  )
            bitonic_merge(A__   ,     low + middle   ,     A__   ,     A__  )
def   a   (    A__			:     list[int]   ,     A__			:     int   ,     A__			:     int   ,     A__			:     int  )					->   None:





      """simple docstring"""



      if length > 1:
            _lowercase			 =int(length / 2  )
            bitonic_sort(A__   ,     A__   ,     A__   ,     1  )
            bitonic_sort(A__   ,     low + middle   ,     A__   ,     0  )
            bitonic_merge(A__   ,     A__   ,     A__   ,     A__  )


if __name__ == "__main__":
  lowercase_             =     input('Enter numbers separated by a comma:\n').strip()
  lowercase_             =     [int(item.strip()) for item in user_input.split(',')]

  bitonic_sort(unsorted, 0, len(unsorted), 1)
  print('\nSorted array in ascending order is: ', end='')
  print(*unsorted, sep=', ')

  bitonic_merge(unsorted, 0, len(unsorted), 0)
  print('Sorted array in descending order is: ', end='')
  print(*unsorted, sep=', ')





import os
def   a   (    )					->   Optional[int]:





      """simple docstring"""



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

            _lowercase			 =0

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

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

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

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


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


