#include <bits/stdc++.h>
using namespace std;
long long a[102], b[102];
long long cn[103];
int main() {
  long long n, m;
  cin >> n >> m;
  long long k;
  memset(a, -1, sizeof(a));
  for (long long i = 1; i <= m; i++)
    for (long long j = 1; j <= n; j++) {
      cin >> k;
      if (k > a[i]) {
        a[i] = k;
        b[i] = j;
      }
    }
  for (long long i = 1; i <= m; i++) {
    cn[b[i]]++;
  }
  long long mx = 0, win = 1;
  for (long long i = 1; i <= n; i++) {
    if (cn[i] > mx) {
      mx = cn[i];
      win = i;
    }
  }
  cout << win << endl;
  return 0;
}
