#include <bits/stdc++.h>
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<int> candidates(n);
  for (int i = 0; i < m; ++i) {
    std::vector<int> xx(n);
    for (int& x : xx) {
      std::cin >> x;
    }
    ++candidates[std::distance(xx.begin(),
                               std::max_element(xx.begin(), xx.end()))];
  }
  std::cout << (std::distance(
                    candidates.begin(),
                    std::max_element(candidates.begin(), candidates.end())) +
                1)
            << std::endl;
}
