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