#include <bits/stdc++.h>
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m) == 2) {
    int a[100][100], r[100], i, j;
    for (i = 0; i < 100; i++) {
      r[i] = 0;
    }
    for (i = 0; i < m; i++) {
      for (j = 0; j < n; j++) {
        scanf("%d", &a[i][j]);
      }
    }
    for (i = 0; i < m; i++) {
      int k = 0, ma = 0;
      for (j = 0; j < n; j++) {
        if (ma < a[i][j]) {
          ma = a[i][j];
          k = j;
        }
      }
      r[k] = r[k] + 1;
    }
    int rs = 0, mx = 0;
    for (j = 0; j < n; j++) {
      if (r[j] > mx) {
        mx = r[j];
        rs = j;
      }
    }
    printf("%d\n", rs + 1);
  }
  return 0;
}
