#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, max;
  cin >> n >> m;
  long long a[m][n];
  long long ct[1000] = {0};
  for (long long i = 0; i < m; i++) {
    for (long long j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  long long winner, mx = 0;
  for (long long i = 0; i <= m - 1; i++) {
    long long max = -1;
    for (int j = 0; j <= n - 1; j++) {
      if (a[i][j] > max) {
        max = a[i][j];
        winner = j;
      }
    }
    ct[winner]++;
  }
  for (int i = 0; i <= n - 1; i++) {
    if (ct[i] > mx) {
      mx = ct[i];
      winner = i;
    }
  }
  cout << winner + 1 << endl;
}
