#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9, mod = 1e9 + 7, N = 3e5;
const long long linf = 1e18;
long long a[N], n, m, mx, b[N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    memset(a, 0, sizeof a);
    for (int j = 1; j <= n; j++) {
      int x;
      cin >> x;
      a[j] += x;
    }
    int mx = 1;
    for (int j = 2; j <= n; j++)
      if (a[mx] < a[j]) mx = j;
    b[mx]++;
  }
  int mx = 1;
  for (int i = 2; i <= n; i++)
    if (b[mx] < b[i]) mx = i;
  cout << mx;
  return 0;
}
