#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, i, j, n, mx, p, b[1001], m;
  cin >> n >> m;
  for (i = 1; i <= 1000; i++) b[i] = 0;
  for (i = 1; i <= m; i++) {
    mx = -1;
    p = -1;
    for (j = 1; j <= n; j++) {
      cin >> a;
      if (a > mx) {
        mx = a;
        p = j;
      }
    }
    b[p]++;
  }
  int bmax = b[1], pmax = 1;
  for (i = 2; i <= 1000; i++)
    if (b[i] > bmax) {
      bmax = b[i];
      pmax = i;
    }
  cout << pmax;
  return 0;
}
