#include <bits/stdc++.h>
using namespace std;
int nC[100];
int main() {
  ios::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int max = -1;
    int maxI = 0;
    for (int j = 0, k; j < n; ++j) {
      cin >> k;
      if (k > max) {
        maxI = j;
        max = k;
      }
    }
    ++nC[maxI];
  }
  int max = 0;
  for (int i = 0; i < n; ++i) {
    if (nC[i] > nC[max]) max = i;
  }
  cout << max + 1 << endl;
  return 0;
}
