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

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

#ifndef EVAL
int a[105][105];
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 > 2) {
        int p1 = st + (dr - st) / 3, p2 = st + (dr - st) / 3 * 2;
        a = value(1, p1);
        b = value(1, p2);
        if(a <= b) 
            dr = p2;
        else
            st = p1;
    }

    a = value(1, st);
    b = value(1, dr);
    if(st == dr)
        return {1, st};
    else if(dr == st + 1)
        return (a <= b ? make_pair(1, st) : make_pair(1, dr));
    else {
        ll c = value(1, st + 1);
        ll mini = min(a, min(b, c));
        if(a == mini)
            return {1, st};
        else if(b == mini)
            return {1, dr};
        else
            return {1, st+1};
    }
}

#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