#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, max;
  unsigned long vote[105][105], city[105], cand[105] = {0};
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) cin >> vote[i][j];
  }
  for (i = 0; i < m; i++) {
    city[i] = 0;
    for (j = 1; j < n; j++) {
      if (vote[i][j] > vote[i][city[i]]) city[i] = j;
    }
  }
  for (i = 0; i < m; i++) {
    cand[city[i]]++;
  }
  max = j = 0;
  for (i = 0; i < n; i++) {
    if (cand[i] > j) {
      max = i;
      j = cand[i];
    }
  }
  cout << max + 1;
  return 0;
}
