


import os





def   __snake_case			(    ):
    with open(os.path.dirname(_UpperCAmelCase       ) + '''/grid.txt'''       ) as f:
        __a		 =       []  # noqa: E741
        for _ in range(20       ):
            l.append([int(_UpperCAmelCase       ) 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())










from __future__ import annotations





def   __snake_case			(    _UpperCAmelCase     ,				_UpperCAmelCase       ):
    print(f'Vertex\tShortest Distance from vertex {src}'       )
    for i, d in enumerate(_UpperCAmelCase       ):
        print(f'{i}\t\t{d}'       )





def   __snake_case			(    _UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase       ):
    for j in range(_UpperCAmelCase       ):
        __a ,     __a ,     __a		 =       (graph[j][k] for k in ['''src''', '''dst''', '''weight'''])
        if distance[u] != float('''inf'''       ) and distance[u] + w < distance[v]:
            return True
    return False





def   __snake_case			(    _UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase       ):
    __a		 =       [float('''inf'''       )] * vertex_count
    __a		 =       0.0

    for _ in range(vertex_count - 1       ):
        for j in range(_UpperCAmelCase       ):
            __a ,     __a ,     __a		 =       (graph[j][k] for k in ['''src''', '''dst''', '''weight'''])

            if distance[u] != float('''inf'''       ) and distance[u] + w < distance[v]:
                __a		 =       distance[u] + w

    __a		 =       check_negative_cycle(_UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase       )
    if negative_cycle_exists:
        raise Exception('''Negative cycle found'''       )

    return distance


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 __snake_case		:Dict   	=  int(input('''Enter number of vertices: ''').strip())
 __snake_case		:Any   	=  int(input('''Enter number of edges: ''').strip())

 __snake_case		:list[dict[str, int]]   	=  [{} for _ in range(E)]

 for i in range(E):
  print('''Edge ''', i + 1)
  __snake_case	,__snake_case	,__snake_case		:int   	=  (
      int(x)
      for x in input('''Enter source, destination, weight: ''').strip().split(''' ''')
  )
  __snake_case		:Any   	=  {'''src''': src, '''dst''': dest, '''weight''': weight}

 __snake_case		:List[str]   	=  int(input('''\nEnter shortest path source:''').strip())
 __snake_case		:Optional[Any]   	=  bellman_ford(graph, V, E, source)
 print_distance(shortest_distance, 0)





