#include <bits/stdc++.h>
int main() {
  int n, m, i, j;
  scanf("%d %d", &n, &m);
  long long vote[n], final[n], choose[m], p, a, result;
  for (i = 0; i < m; i++) {
    p = -1;
    for (j = 0; j < n; j++) {
      scanf("%I64d", &vote[j]);
      if (vote[j] > p) {
        p = vote[j];
        choose[i] = j + 1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    final[i] = 0;
    for (j = 0; j < m; j++) {
      if (choose[j] == i + 1) {
        final[i] = final[i] + 1;
      }
    }
  }
  a = 0;
  for (i = 0; i < n; i++) {
    if (final[i] > a) {
      a = final[i];
      result = i + 1;
    }
  }
  printf("%I64d", result);
}
