#include <bits/stdc++.h>
using namespace std;
long long n, m, x, mx, mn, c[1000], res, rn;
int main() {
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    mx = 0;
    mn = 0;
    for (long long j = 0; j < n; j++) {
      cin >> x;
      if (x > mx) {
        mx = x;
        mn = j;
      }
    }
    c[mn]++;
  }
  for (long long i = 0; i < n; i++) {
    if (c[i] > res) {
      res = c[i];
      rn = i;
    }
  }
  cout << rn + 1;
  return 0;
}
