#include <bits/stdc++.h>
using namespace std;
const long double EPS = 3e-16;
const long long MAXN = 102;
const long long INF = 1e9 + 7;
void file() {
  freopen(
      "choose"
      ".in",
      "r", stdin);
  if (0)
    freopen(
        "choose"
        ".out",
        "w", stdout);
}
int gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int n, m;
int a[MAXN][MAXN];
int pew[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int maxa = -1, id = 0;
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (maxa < a[i][j]) {
        maxa = a[i][j];
        id = j;
      }
    }
    pew[id]++;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (pew[ans] < pew[i]) ans = i;
  }
  cout << ans + 1;
  cout << endl;
  return 0;
}
