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