#include <bits/stdc++.h>
using namespace std;
long long A[105][105];
int win[105];
int main() {
  int n, m, i, j, maxi, maxj;
  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++) {
    maxi = INT_MIN;
    for (j = 1; j <= n; j++)
      if (A[i][j] > maxi) {
        maxi = A[i][j];
        maxj = j;
      }
    win[maxj]++;
  }
  maxi = INT_MIN;
  for (i = 1; i <= n; i++)
    if (win[i] > maxi) {
      maxi = win[i];
      maxj = i;
    }
  cout << maxj;
  return 0;
}
