#include <bits/stdc++.h>

using namespace std;
using ll = long long;

ll value(int r, int c);

map<array<int, 2>, ll> mp;
ll val(int r, int c) {
    if (mp.find({r, c}))
        return mp[{r, c}];
    mp[{r, c}] = value(r, c);
    return mp[{r, c}];
}

// < is false
// > is true
bool sg(int k) {
    return val(1, k) > val(1, k + 1);
}

pair<int, int> find_locmin_point(int N, int M) {
    if (M == 1) return {1, 1};
    if (!sg(1)) return {1, 1};
    if (sg(M - 1)) return {1, M};
    int l = 1, r = M - 1;
    while (r - l > 1) {
        int k = (l + r) / 2;
        if (sg(k)) l = k;
        else r = k;
    }
    return {1, r};
}




























#ifdef LOCAL
static const int MAXN=500,MAXM=500;
static long long int tab[MAXN][MAXM];
static int n,m;
static void finish (string message) {
    cout << message << endl ;
    exit(0);
}

static int cnt=0;
long long int value (int row, int col) {
    row--; col--;
    if ((row<0)||(row>=n)||(col<0)||(col>=m)) finish("Invalid row or column number in question ("+to_string(row)+","+to_string(col)+")!");
    cnt++;
    if (cnt>n*m) finish("Too many questions!");
    return tab[row][col];
}
extern pair <int, int> find_locmin_point (int, int);

static int drow[]={ -1, -0, +0, +1 };
static int dcol[]={ -0, -1, +1, +0 };
static bool check_saddle (int row, int col) {
    for (int i=0; i<4; i++) {
        int r=row+drow[i],c=col+dcol[i];
        if ((r<0)||(r>=n)||(c<0)||(c>=m)) continue;
        if (tab[r][c]<=tab[row][col]) return false;
    }
    return true;
}
int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m ;
    for (int i=0; i<n; i++) {
        for (int j=0; j<m; j++) {
            cin >> tab[i][j] ;
        }
    }
    auto [r, c]=find_locmin_point(n,m);
    cout << "Answer cell: (" << r << "," << c << ")\n";
    cout << "Number of value calls: " << cnt << endl ;
    r--; c--;
    if ((r<0)||(r>=n)||(c<0)||(c>=m)) finish("Invalid row or column in answer!");
    if (check_saddle(r,c)==false) finish("Answer is not a local minimum point!");
    finish("Correctly found local minimum point.");
    return 0;
}


#endif
