k, n = map(int, input().split())
W = [0] * (k+1);
for j in range(1, n+1):
V = [0] + [int(v) for v in input().split()]
max_vote = -1
max_i = 0 # dowolna wartość
for i in range(1, k+1):
if(V[i] > max_vote):
max_vote = V[i]
max_i = i
W[max_i] += 1
max_win = 0
max_i = 0
for i in range(1, k+1):
if(W[i] > max_win):
max_win = W[i]
max_i = i
print(max_i)