#include <bits/stdc++.h>
int main() {
  int n, m;
  int i, j;
  while (scanf("%d%d", &n, &m) == 2) {
    int v[n + 5];
    for (i = 1; i <= n; i++) {
      v[i] = 0;
    }
    long int rmax = -1, rindex = 101;
    for (i = 1; i <= m; i++) {
      int m = -1, index = 101;
      long int number;
      for (j = 1; j <= n; j++) {
        scanf("%ld", &number);
        if (number > m) {
          m = number, index = j;
        }
      }
      v[index]++;
      if (v[index] > rmax) {
        rmax = v[index], rindex = index;
      }
      if (v[index] == rmax && index < rindex) {
        rindex = index;
      }
    }
    printf("%ld\n", rindex);
  }
  return 0;
}
