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