#include <bits/stdc++.h>
long long win[200];
int main() {
  long long n, i, j, m, a, can, num, in;
  scanf("%lld%lld", &n, &m);
  for (i = 1; i <= m; i++) {
    num = 0;
    in = 0;
    for (j = 1; j <= n; j++) {
      scanf("%lld", &a);
      if (j == 1 || a > num) {
        num = a;
        in = j;
      }
    }
    win[in] = win[in] + 1;
  }
  can = 0;
  num = 0;
  for (i = 1; i <= n; i++) {
    if (i == 1 || win[i] > num) {
      can = i;
      num = win[i];
    }
  }
  printf("%lld\n", can);
  return 0;
}
