#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int arr[m];
  int maxi = -1, a, indi;
  int cand[n];
  for (int i = 0; i < m; i++) {
    maxi = -1;
    for (int j = 0; j < n; j++) {
      scanf("%d", &a);
      if (a > maxi) {
        indi = j;
        maxi = a;
      }
    }
    arr[i] = indi;
  }
  for (int i = 0; i < n; i++) cand[i] = 0;
  maxi = -1;
  int indi2 = 99999;
  for (int i = 0; i < m; i++) {
    cand[arr[i]]++;
  }
  for (int i = 0; i < n; i++) {
    if (cand[i] > maxi) {
      indi2 = i;
      maxi = cand[i];
    }
  }
  printf("%d\n", indi2 + 1);
}
