#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int mxwinner = 0;
  map<int, int> mp;
  map<int, int>::iterator it;
  for (int i = 0; i < m; i++) {
    int citywinner, winvalue = -1;
    for (int j = 0; j < n; j++) {
      int tmp;
      cin >> tmp;
      if (tmp > winvalue) {
        citywinner = j + 1;
        winvalue = tmp;
      }
    }
    mp[citywinner]++;
    mxwinner = max(mxwinner, mp[citywinner]);
  }
  for (it = mp.begin(); it != mp.end(); it++) {
    if (it->second == mxwinner) {
      cout << it->first << endl;
      break;
    }
  }
  return 0;
}
