#include <bits/stdc++.h>
using namespace std;
struct RTC {
  ~RTC() { cerr << "Time: " << clock() * 1.0 / CLOCKS_PER_SEC << " seconds\n"; }
} runtimecount;
int n, m;
int solve(vector<int> vec) {
  int maxi = -1;
  for (int i = 0; i < ((int)(vec).size()); i++) {
    if (maxi == -1 || vec[i] > vec[maxi]) maxi = i;
  }
  return maxi;
}
map<int, int> cnt;
int ans() {
  int maxi = -1;
  for (auto e : cnt) {
    if (maxi == -1 || e.second > cnt[maxi]) maxi = e.first;
  }
  return maxi;
}
int main() {
  ios_base::sync_with_stdio(false);
  vector<int> tmp;
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (m); i++) {
    vector<int> a;
    for (int j = 0; j < (n); j++) {
      int b;
      cin >> b;
      a.push_back(b);
    }
    tmp.push_back(solve(a) + 1);
  }
  for (int e : tmp) cnt[e]++;
  cout << ans() << endl;
  return 0;
}
