#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, val, i, j;
  cin >> n;
  cin >> m;
  int votes[m][n];
  int second[101] = {0};
  for (i = 0; i < m; i++) {
    int maxs = -1;
    for (j = 0; j < n; j++) {
      cin >> votes[i][j];
      if (maxs < votes[i][j]) {
        maxs = votes[i][j];
        val = j;
      }
    }
    second[val]++;
  }
  int maxs = -1;
  for (i = 0; i < n; i++) {
    if (maxs < second[i]) {
      maxs = second[i];
      val = i;
    }
  }
  cout << val + 1 << endl;
}
