#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m][n];
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  int ans[n];
  memset(ans, 0, sizeof(ans));
  int k = 0;
  int x = 0, y = 0;
  int ma = INT_MIN;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] > ma) {
        x = j;
        ma = a[i][j];
      }
    }
    ans[x]++;
    ma = INT_MIN;
  }
  ma = INT_MIN;
  for (int i = 0; i < n; i++) {
    if (ans[i] > ma) {
      x = i;
      ma = ans[i];
    }
  }
  cout << x + 1 << endl;
}
