#include <bits/stdc++.h>
#define mp make_pair
#ifdef EVAL
#include "locmin.h"
#endif

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;

int lol[505][505];
#ifndef EVAL
int a[505][505];
ll value(int x, int y) {
    return a[x][y];
}
#endif
pii find_locmin_point(int n, int m) {
    int st = 1, dr = m;
    ll a, b;
    while(dr - st > 1) {
        int p1 = st + (dr - st + 1) / 3, p2 = dr -  (dr - st + 1) / 3;
        a = (lol[1][p1] ? lol[1][p1] : lol[1][p1] = value(1, p1));
        b = (lol[1][p2] ? lol[1][p2] : lol[1][p2] = value(1, p2));
        if(a <= b)
            dr = p2;
        else
            st = p1;
    }

    if(st == dr)
        return {1, st};
    a = (lol[1][st] ? lol[1][st] : lol[1][st] = value(1, st));
    b = (lol[1][dr] ? lol[1][dr] : lol[1][dr] = value(1, dr));
    return (a <= b ? mp(1, st) : mp(1, dr));
}

#ifndef EVAL
int main() {
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
    int n, m;
    cin >> n >> m;
    for(int i=1; i<=n; i++)
        for(int j=1; j<=m; j++)
            cin >> a[i][j];
    auto [ansx, ansy] = find_locmin_point(n, m);
    cout << ansx << ' ' << ansy << ' ' << a[ansx][ansy];
    return 0;
}
#endif