#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int c[n];
  memset(c, 0, sizeof(c));
  while (m--) {
    int x, y = 0, p = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &x);
      if (x > y) {
        y = x;
        p = i;
      }
    }
    c[p]++;
  }
  int y = 0, p;
  for (int i = 0; i < n; i++) {
    if (c[i] > y) {
      y = c[i];
      p = i;
    }
  }
  printf("%d", p + 1);
  return 0;
}
