#include <bits/stdc++.h>
using namespace std;
int a[200];
int cnt[200];
int main() {
  int n, m;
  ios::sync_with_stdio(false);
  memset(cnt, 0, sizeof(cnt));
  cin >> n >> m;
  int mx, mk, x;
  for (int i = 1; i <= m; i++) {
    mx = 0;
    mk = 0;
    x = 0;
    for (int j = 1; j <= n; j++) {
      cin >> x;
      if (mx < x) {
        mk = j;
        mx = x;
      }
    }
    if (mk == 0) mk = 1;
    cnt[mk]++;
  }
  mx = 0, mk = 0;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] > mx) {
      mx = cnt[i];
      mk = i;
    }
  }
  if (mk == 0) mk = 1;
  cout << mk << endl;
  return 0;
}
