#00011F

z-matrix

Little Z has found nxm matrix A filed with integers. He wants to erase all numbers in exactly two rows and two columns in order to get maximum possible multiplication of the rest of the numbers.


InputThe first line of the standard input contains two space-separated cardinals n and m (3 <= n, m <= 30). In each of the next n lines are listed m space-separated integers. j-th integer in i-th line represents number at i-th row and j-th column of the matrix A. All integers are from interval [-1000, 1000].

OutputOn the standard output you should print 4 integers that represent 1-based sorted indices of rows and columns that Little Z should erase. In there are more solutions, print the first lexicographically.

Input:
3 4
1 1 2 2
3 3 4 4
5 5 5 5

Output:
1 1 2 2

Explanation:
Erasing 1st row and column and 2nd row and column will leave us with product 5 * 5 = 25.
Note that indices are not printed in order (row, column), but in sorted order. Also, we could erase, i.e., 2nd and 4th column and get the same product, but it will lead to lexicographically greater output.

Input:
4 5
0 -2 1 6 200
13 18 20 -11 22
1 4 2 9 2
9 8 0 0 -1

Output:
1 3 3 4

Explanation:
Erase 3rd and 4th row and 1st and 3rd column.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.