#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  map<int, int> mp;
  while (m--) {
    int max = -1;
    int pos = 1;
    int arr[n + 1];
    for (int i = 1; i <= n; i++) {
      cin >> arr[i];
      if (arr[i] > max) {
        max = arr[i];
        pos = i;
      }
    }
    mp[pos]++;
  }
  int max = -1;
  int ans = 0;
  for (auto it = mp.begin(); it != mp.end(); ++it) {
    if (it->second > max) {
      max = it->second;
      ans = it->first;
    }
  }
  cout << ans << endl;
}
