#include <bits/stdc++.h>
int main() {
  int n, m, i, j, maxcand;
  int maxv = -1, v;
  scanf("%d%d", &n, &m);
  int cand[n];
  for (i = 0; i < n; i++) cand[i] = 0;
  for (i = 0; i < m; i++) {
    for (j = 1; j <= n; j++) {
      scanf("%d", &v);
      if (v > maxv) {
        maxv = v;
        maxcand = j;
      }
    }
    cand[maxcand - 1] = cand[maxcand - 1] + 1;
    maxv = -1;
  }
  int maxwon = 0, winner;
  for (i = 0; i < n; i++) {
    if (cand[i] > maxwon) {
      maxwon = cand[i];
      winner = i + 1;
    }
  }
  printf("%d\n", winner);
  return 0;
}
