#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, mxind, ans = 1;
  vector<int> win(101, 0);
  long long a, mx = 0;
  cin >> m >> n;
  for (int i = 1; i <= n; i++) {
    mx = 0;
    mxind = 1;
    for (int j = 1; j <= m; j++) {
      cin >> a;
      if (a > mx) {
        mxind = j;
        mx = a;
      }
    }
    win[mxind]++;
  }
  for (int i = 1; i <= m; i++)
    if (win[ans] < win[i]) ans = i;
  cout << ans << endl;
}
