public static void main(String[] args) {
		int max = 0;

		//all vertical
		for (int x = 0; x <= 16; x++) {
			for (int y = 0; y <= 19; y++) {
				int[][] coords = {{x,y},{x+1,y},{x+2,y},{x+3,y}};
				max = Math.max(max, product(coords));
			}
		}
		//all horizontal
		for (int x = 0; x <= 19; x++) {
			for (int y = 0; y <= 16; y++) {
				int[][] coords = {{x,y},{x,y+1},{x,y+2},{x,y+3}};
				max = Math.max(max, product(coords));
			}
		}
		//all diagonal down
		for (int x = 0; x <= 16; x++) {
			for (int y = 0; y <= 16; y++) {
				int[][] coords = {{x,y},{x+1,y+1},{x+2,y+2},{x+3,y+3}};
				max = Math.max(max, product(coords));
			}
		}
		//all diagonal up, reversing x iteration
		for (int x = 19; x >= 3; x--) {
			for (int y = 0; y <= 16; y++) {
				int[][] coords = {{x,y},{x-1,y+1},{x-2,y+2},{x-3,y+3}};
				max = Math.max(max, product(coords));
			}
		}

		System.out.println(max);


	}