#include <stdio.h>

int main() {
    int n, m, num, max, x, y = 0;
    scanf("%d %d", &n, &m);
    for (int i = 0; i < n; i ++ ) {
        for (int j = 0; j < m; j++) {
            scanf("%d", &num);
            if (num > max) {
                max = num;
                x = i;
                y = j;
            }
        }
    }
    printf("%d %d\n",x+1,y+1);
    return 0;
}