#include <bits/stdc++.h>
int a[128][128], v[128], cor[128], bucket[128];
int m, n;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &v[i]);
    cor[i] = 1;
    for (int j = 2; j <= n; ++j) {
      int x;
      scanf("%d", &x);
      if (x > v[i]) {
        v[i] = x;
        cor[i] = j;
      }
    }
  }
  for (int i = 1; i <= m; ++i) {
    bucket[cor[i]]++;
  }
  int rez = bucket[1];
  int cand = 1;
  for (int i = 2; i <= n; ++i) {
    if (bucket[i] > rez) {
      rez = bucket[i];
      cand = i;
    }
  }
  printf("%d\n", cand);
  return 0;
}
