#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int m, n;
while(cin >> m >> n)
{
int k = m * n;
int s, t, i;
cin >> s; /*第一个数*/
int x = 1, y = 1;
for(i = 1; i < k ; i++) /*让i从1开始,巧妙避开了位置探寻的难题*/
{
cin >> t;
if(abs(t) > abs(s))
{
s = t;
x = i / n + 1; /*若i从2开始,显然在i=6时不好处理*/
y = i % n + 1;
}
}
cout << x << " " << y << " " << s << endl;
}
return 0;
}