#include <bits/stdc++.h>
using namespace std;
class comp {
 public:
  comp() { ; }
  bool operator()(const pair<int, int>& lhs, const pair<int, int>& rhs) const {
    if (lhs.first != rhs.first) {
      return lhs.first < rhs.first;
    } else {
      return lhs.second > rhs.second;
    }
  }
};
int main() {
  int n(0), m(0);
  typedef priority_queue<pair<int, int>, vector<pair<int, int>>, comp>
      pair_queue;
  pair_queue winners;
  cin >> n >> m;
  vector<pair_queue> local_winners(m);
  vector<int> city_count(n + 1);
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) {
      int a(0);
      cin >> a;
      local_winners[i].push(make_pair(a, j + 1));
    }
  }
  for (int i = 0; i < m; ++i) {
    city_count[local_winners[i].top().second]++;
  }
  for (int i = 1; i < n + 1; ++i) {
    winners.push(make_pair(city_count[i], i));
  }
  cout << winners.top().second << endl;
}
