#include <bits/stdc++.h>
using namespace std;
long d[105];
int main() {
  long n, m, i, j, a[105][105], M, p;
  cin >> n >> m;
  for (i = 1; i <= m; i++)
    for (j = 1; j <= n; j++) cin >> a[i][j];
  for (i = 1; i <= m; i++) {
    M = a[i][1];
    p = 1;
    for (j = 2; j <= n; j++) {
      if (a[i][j] > M) {
        M = a[i][j];
        p = j;
      }
    }
    d[p]++;
  }
  M = d[1];
  p = 1;
  for (i = 2; i <= n; i++)
    if (d[i] > M) {
      M = d[i];
      p = i;
    }
  cout << p;
  return 0;
}
