#include <bits/stdc++.h>
constexpr bool LOG = false;
using namespace std;
using vi = vector<int>;
using ll = long long;
constexpr int INF = 1e9 + 1;
constexpr ll LLINF = 1e18 + 1;
void Log() {
  if (LOG) cerr << "\n";
}
template <class T, class... S>
void Log(T t, S... s) {
  if (LOG) cerr << t << "\t", Log(s...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  vi citycount(N, 0);
  for (auto i = decltype(M)(0); i < (M); i++) {
    int best = -1, win = -1;
    for (auto i = decltype(N)(0); i < (N); i++) {
      int x;
      cin >> x;
      if (x > best) best = x, win = i;
    }
    citycount[win]++;
  }
  int best = -1, win = -1;
  for (auto i = decltype(N)(0); i < (N); i++) {
    int x = citycount[i];
    if (x > best) best = x, win = i;
  }
  cout << win + 1 << "\n";
  return 0;
}
