num=input().split(" ")
n,m=map(int,num)
matrix_list=[]
for i in range(n):
    matrix_val=input().split(" ")
    matrix_list.append(matrix_val)
max_val=matrix_list[0][0]
maxi=maxj=0
for i in range(n):
    for j in range(m):
        if int(matrix_list[i][j])>int(max_val):
            max_val=matrix_list[i][j]
            maxi=i 
            maxj=j
print("{} {}".format(maxi+1,maxj+1))