#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int ara[m][n], win[n];
  memset(win, 0, sizeof(win));
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &ara[i][j]);
    }
  }
  for (int i = 0; i < m; i++) {
    int mx = ara[i][0], pos = 0;
    for (int j = 0; j < n; j++) {
      if (ara[i][j] > mx) {
        mx = ara[i][j];
        pos = j;
      }
    }
    win[pos]++;
  }
  int mx = win[0], pos = 0;
  for (int i = 0; i < n; i++) {
    if (win[i] > mx) {
      mx = win[i];
      pos = i;
    }
  }
  printf("%d\n", pos + 1);
  return 0;
}
