#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, mx, cand;
  cin >> n >> m;
  map<int, int> cnt;
  map<int, int>::iterator it;
  for (int i = 0; i < m; ++i) {
    mx = -1;
    for (int j = 0; j < n; ++j) {
      int a;
      cin >> a;
      if (a > mx) {
        mx = a;
        cand = j + 1;
      }
    }
    cnt[cand]++;
  }
  mx = -1;
  for (it = cnt.begin(); it != cnt.end(); ++it) {
    if (it->second > mx) {
      mx = it->second;
      cand = it->first;
    }
  }
  cout << cand;
  return 0;
}
