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