#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m) {
    int idx, best, aux;
    int cityVotes[105];
    memset(cityVotes, 0, sizeof cityVotes);
    for (int i = 0; i < m; ++i) {
      best = -1;
      for (int j = 0; j < n; ++j) {
        cin >> aux;
        if (aux > best) {
          best = aux;
          idx = j + 1;
        }
      }
      ++cityVotes[idx];
    }
    best = 0;
    for (int i = 1; i <= n; ++i) {
      if (best < cityVotes[i]) {
        best = cityVotes[i];
        idx = i;
      }
    }
    cout << idx << '\n';
  }
  return 0;
}
