#include <bits/stdc++.h>
int main() {
  long a[101][101], b[101], s, max, n, m;
  int i, j;
  scanf("%ld %ld", &n, &m);
  for (i = 1; i <= m; i++)
    for (j = 1; j <= n; j++) scanf("%ld", &a[i][j]);
  for (i = 1; i <= n; i++) b[i] = 0;
  for (i = 1; i <= m; i++) {
    max = a[i][1];
    s = 1;
    for (j = 2; j <= n; j++)
      if (a[i][j] > max) {
        s = j;
        max = a[i][j];
      }
    b[s]++;
  }
  max = b[1];
  s = 1;
  for (i = 2; i <= n; i++)
    if (b[i] > max) {
      s = i;
      max = b[i];
    }
  printf("%d", s);
  return 0;
}
