#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m][n];
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  int cand[n];
  memset(cand, 0, sizeof(cand));
  for (int i = 0; i < m; i++) {
    int max = a[i][0];
    int max_index = 0;
    for (int j = 0; j < n; j++)
      if (a[i][j] > max) {
        max = a[i][j];
        max_index = j;
      }
    cand[max_index]++;
  }
  int max = cand[0];
  int max_index = 0;
  for (int i = 1; i < n; i++) {
    if (cand[i] > max) {
      max = cand[i];
      max_index = i;
    }
  }
  cout << (max_index + 1) << endl;
  return 0;
}
