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