#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, c, a, i, j, x[1000] = {0};
  cin >> r >> c;
  for (i = 0; i < c; i++) {
    int maxi = -1, in = 0;
    for (j = 0; j < r; j++) {
      cin >> a;
      if (a > maxi) {
        in = j;
        maxi = a;
      }
    }
    x[in]++;
  }
  int in = 0;
  for (i = 0; i < r; i++) {
    if (x[in] < x[i]) in = i;
  }
  cout << ++in << endl;
}
