#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, a;
  cin >> n >> m;
  int arr[n + 1];
  for (i = 0; i <= n; i++) arr[i] = 0;
  for (i = 0; i < m; i++) {
    int maxi = 0, ans = 1;
    for (j = 1; j <= n; j++) {
      cin >> a;
      if (a > maxi) {
        maxi = a;
        ans = j;
      }
    }
    arr[ans]++;
  }
  int maxi = 0, el = 1;
  for (i = 1; i <= n; i++) {
    if (arr[i] > maxi) {
      maxi = arr[i];
      el = i;
    }
  }
  cout << el;
}
