#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
int t, n, mx;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> mx;
  for (int i = 0; i < mx; i++) {
    int mini = 0;
    int miniX = 1;
    for (int j = 1; j <= n; j++) {
      cin >> t;
      if (t > mini) {
        mini = t;
        miniX = j;
      }
    }
    if (m.count(miniX) == 0) {
      m[miniX] = 1;
    } else {
      m[miniX] = m[miniX] + 1;
    }
  }
  int lastmin = 0;
  int lastminX = 1;
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) {
    if (lastmin < it->second) {
      lastmin = it->second;
      lastminX = it->first;
    }
  }
  cout << lastminX;
}
