#include <bits/stdc++.h>
int wins_per_cand[100];
int votes[100];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int max = 0;
    int index = 0;
    for (int j = 0; j < n; j++) {
      scanf("%d", &votes[j]);
      if (votes[j] > max) {
        max = votes[j];
        index = j;
      }
    }
    wins_per_cand[index]++;
  }
  int mostvotes = 0;
  int winner = 0;
  for (int i = 0; i < n; i++) {
    if (wins_per_cand[i] > mostvotes) {
      mostvotes = wins_per_cand[i];
      winner = i + 1;
    }
  }
  printf("%d", winner);
  return 0;
}
