#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i1 = 1, i2 = 0;
  long long max1 = 0, max2 = 0, x;
  cin >> n >> m;
  pair<int, int> p;
  vector<pair<int, int> > v;
  for (int i = 0; i < 102; i++) {
    p.first = 0;
    p.second = -105;
    v.push_back(p);
  }
  for (int i = 1; i <= m; i++) {
    max1 = 0;
    i1 = 1;
    for (int j = 1; j <= n; j++) {
      cin >> x;
      if (max1 < x) {
        max1 = x;
        i1 = j;
      }
    }
    v[i1].first++;
    v[i1].second = (-1 * i1);
  }
  sort(v.begin(), v.end());
  cout << (v[v.size() - 1].second) * -1;
  return 0;
}
