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