#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, citys[109] = {0}, arr[109];
  cin >> n >> m;
  for (int f = 0; f < m; f++) {
    int i = 0;
    for (int f1 = 0; f1 < n; f1++) {
      cin >> arr[f1];
      if (arr[f1] > arr[i]) i = f1;
    }
    citys[i]++;
  }
  int ans = 0;
  for (int f = 0; f < n; f++)
    if (citys[ans] < citys[f]) ans = f;
  cout << ans + 1 << endl;
}
