#include <bits/stdc++.h>
using namespace std;
int a[200][200];
int max_id[1000];
int maxx[1000];
int main() {
  int n, m, maximom = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] > a[i][max_id[i]]) max_id[i] = j;
    }
    maxx[max_id[i]]++;
  }
  for (int i = 0; i < n; i++) {
    if (maxx[i] > maxx[maximom]) maximom = i;
  }
  cout << maximom + 1;
  return 0;
}
