int main() {
    int n, m;
    scanf("%d %d", &n, &m);
    int val[n][m], max = 0 ;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            scanf("%d ", &val[i][j]);  //依次输入身高
            if (val[i][j] > max) max = val[i][j];  //判断最大值
        }
    }
    for (int x = 0; x < n; x++) {
        for (int y = 0; y < m; y++) {
            //判断最大值位置并输出
            if (val[x][y] == max) printf("%d %d", x + 1, y + 1);
        }
    }
    return 0;
}