#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> m >> n;
  int count[m];
  memset(count, 0, sizeof(count));
  long long int e[n][m];
  int winner[n];
  memset(winner, 0, sizeof(winner));
  for (int i = 0; i < n; i++) {
    int max = 0;
    for (int j = 0; j < m; j++) {
      cin >> e[i][j];
      if (e[i][j] > max) {
        max = e[i][j];
        winner[i] = j;
      }
    }
    count[winner[i]]++;
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    if (count[i] > count[ans]) ans = i;
  }
  cout << ans + 1;
}
