#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, mx, ke, c[102], ans;
  memset(c, 0, sizeof c);
  cin >> n >> m;
  ans = m;
  for (int i = 0; i < m; i++) {
    mx = -1;
    ke = 1;
    for (int j = 1; j <= n; j++) {
      cin >> a;
      if (mx < a) {
        mx = a;
        ke = j;
      }
    }
    c[ke]++;
  }
  mx = -1;
  ke = 1;
  for (int i = 1; i <= n; i++) {
    if (mx < c[i]) {
      mx = c[i];
      ke = i;
    }
  }
  ans = ke;
  cout << ans << endl;
  return 0;
}
