#include <bits/stdc++.h>
using namespace std;
const int N = 1000200;
long long int n;
long long int m;
long long int ar[200][200];
struct xx {
  long long int widx;
  long long int votes;
};
xx br[N];
bool comp(xx a, xx b) {
  if (a.votes == b.votes) return a.widx < b.widx;
  return a.votes > b.votes;
}
map<long long int, long long int> mm;
int main() {
  cin >> m >> n;
  for (long long int i = 1; i <= n; i++) {
    long long int vv = -1;
    long long int idx = -1;
    for (long long int j = 1; j <= m; j++) {
      long long int x;
      cin >> x;
      if (vv < x) {
        vv = x;
        idx = j;
      }
    }
    mm[idx]++;
  }
  long long int sz = 0;
  for (auto it : mm) {
    long long int base = it.first;
    long long int expo = it.second;
    br[++sz] = {base, expo};
  }
  sort(br + 1, br + sz + 1, comp);
  cout << br[1].widx << endl;
  return 0;
}
