#include <bits/stdc++.h>
int a[110][110];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int b[110] = {0};
  int i, j;
  int max = 0;
  for (j = 0; j < m; j++) {
    max = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &a[j][i]);
      if (a[j][i] > max) max = a[j][i];
    }
    for (i = 0; i < n; i++) {
      if (a[j][i] == max) {
        b[i]++;
        break;
      }
    }
  }
  max = 0;
  for (i = 0; i < n; i++) {
    if (b[i] > max) max = b[i];
  }
  for (i = 0; i < n; i++)
    if (b[i] == max) {
      printf("%d\n", i + 1);
      return 0;
    }
}
