#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int grid[m][n];
  map<long long int, long long int> mymap;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cin >> grid[i][j];
    }
  }
  long long int maximum = INT_MIN, index = -1;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (grid[i][j] > maximum) {
        maximum = grid[i][j];
        index = j + 1;
      }
    }
    mymap[index]++;
    maximum = INT_MIN;
    index = -1;
  }
  map<long long int, long long int>::iterator it;
  maximum = -1;
  index = -1;
  for (it = mymap.begin(); it != mymap.end(); it++) {
    if (it->second > maximum) {
      maximum = it->second;
      index = it->first;
    }
  }
  cout << index << endl;
}
