#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, n, m;
  long long int arr[102][102];
  long long int freq[102];
  memset(freq, 0, sizeof(freq));
  cin >> n >> m;
  if (n == 1) {
    cout << "1" << endl;
    return 0;
  }
  long long int maxi = 0, index;
  for (i = 0; i < m; i++) {
    maxi = -1;
    for (j = 0; j < n; j++) {
      cin >> arr[i][j];
      if (maxi < arr[i][j]) {
        maxi = arr[i][j];
        index = j;
      }
    }
    freq[index]++;
  }
  long long int mini = -1;
  for (i = 0; i < n; i++) {
    if (mini < freq[i]) {
      mini = freq[i];
      index = i;
    }
  }
  cout << index + 1 << endl;
  return 0;
}
