#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll MOD = 100000000;
ll INF = 1e17;
bitset<10000010> bs;
vector<int> primes;
void solve(int testCase) {
  int n, m;
  cin >> n >> m;
  ll v2[n + 1];
  memset(v2, 0, sizeof(v2));
  for (int i = 1; i <= m; i++) {
    ll mx = -1;
    ll mxIdx = -1;
    for (int j = 1; j <= n; j++) {
      ll x;
      cin >> x;
      if (mx < x) {
        mxIdx = j;
        mx = x;
      }
    }
    v2[mxIdx]++;
  }
  ll mx = -1;
  int ans = -1;
  for (int i = 1; i <= n; i++) {
    if (v2[i] > mx) {
      ans = i;
      mx = v2[i];
    }
  }
  cout << (ans) << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  int T = 1;
  for (int t = 1; t <= T; t++) {
    solve(t);
  }
  return 0;
}
