#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T ncr(T n, T r) {
  return n * (n - 1) / r;
}
int num[101][101], cnt[101], win[101];
pair<int, int> p[101];
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) cin >> num[i][j];
  for (int i = 0; i < m; i++) {
    int mx = -1;
    for (int j = 0; j < n; j++) {
      if (mx < num[i][j]) {
        mx = num[i][j];
        win[i] = j;
      }
    }
  }
  for (int j = 0; j < m; j++) cnt[win[j]]++;
  int mx = -1;
  for (int j = 0; j < n; j++) mx = max(mx, cnt[j]);
  for (int j = 0; j < n; j++) {
    if (mx == cnt[j]) {
      cout << j + 1 << "\n";
      return 0;
    }
  }
  return 0;
}
