#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> m >> n;
  vector<int> v_total;
  v_total.assign(m + 1, 0);
  for (int i = 1; i <= n; i++) {
    int maximum = -1, mark;
    for (int j = 1; j <= m; j++) {
      int temp;
      cin >> temp;
      if (temp > maximum) {
        maximum = temp;
        mark = j;
      }
    }
    v_total[mark]++;
  }
  int maximum = -1, mark;
  for (int i = 1; i <= m; i++) {
    if (v_total[i] > maximum) {
      maximum = v_total[i];
      mark = i;
    }
  }
  cout << mark << endl;
  return 0;
}
