#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;

#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, pp1 = 0, pp2 = 0;
    ll a, b;
    while(dr - st > 1) {
        int p1 = st + (dr - st + 1) / 3, p2 = dr -  (dr - st + 1) / 3;
        if(p1 != pp1)
            a = value(1, p1);
        if(p2 != pp2)
            b = value(1, p2);
        if(a <= b) 
            dr = p2;
        else
            st = p1;
        
        pp1 = p1;
        pp2 = p2;
    }

    if(st == dr)
        return {1, st};
    if(st != pp1)
        a = value(1, st);
    if(dr != pp2)
        b = 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