#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.first != b.first) return a.first > b.first;
  return a.second < b.second;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<pair<int, int> > men(n);
  for (int i = 0; i < m; ++i) {
    int who = -1, how_much = -1;
    for (int j = 0; j < n; ++j) {
      int k;
      scanf("%d", &k);
      if (k > how_much) how_much = k, who = j;
    }
    ++men[who].first;
  }
  for (int i = 0; i < n; ++i) men[i].second = i;
  sort(men.begin(), men.end(), cmp);
  cout << men[0].second + 1;
  return 0;
}
