#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> v(m, vector<int>(n));
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cin >> v[i][j];
    }
  }
  vector<int> cities(n, 0);
  int maxC = 0, winner;
  for (int i = 0; i < m; i++) {
    int maxV = v[i][0], maxi = 0;
    for (int j = 1; j < n; j++) {
      if (v[i][j] > maxV) {
        maxV = v[i][j];
        maxi = j;
      }
    }
    cities[maxi]++;
  }
  for (int i = 0; i < n; i++) {
    if (cities[i] > maxC) {
      maxC = cities[i];
      winner = i;
    }
  }
  cout << winner + 1;
}
