import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt(), mx = 0, mxi = 0, mxj = 0;
        for(int i = 1; i <= n; ++i){
            for(int j = 1; j <= m; ++j){
                int h = sc.nextInt();
                if(mx < h){
                    mx = h;
                    mxi = i;
                    mxj = j;
                }
            }
        }
        System.out.printf("%d %d", mxi, mxj);
    }
}