#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  set<pair<int, int> > a[200], l;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      int t;
      cin >> t;
      a[i].insert(make_pair(-t, j + 1));
    }
  }
  int aa[300];
  memset(aa, 0, sizeof(aa));
  for (int i = 0; i < m; i++) {
    pair<int, int> ta = *a[i].begin();
    aa[ta.second]++;
  }
  int ans = -1, mx = -1;
  for (int i = 1; i <= n; i++) {
    if (mx < aa[i]) {
      mx = aa[i];
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
