#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[110][110], i, j, maxi, f, maxid[110], c = 0, poi;
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) scanf("%d", &a[i][j]);
  }
  for (i = 0; i < m; i++) {
    maxi = a[i][0];
    maxid[i] = 0;
    for (j = 0; j < n; j++) {
      if (maxi < a[i][j]) {
        maxi = a[i][j];
        maxid[i] = j;
      }
    }
  }
  f = 0;
  sort(maxid, maxid + m);
  poi = maxid[0];
  for (i = 1; i < m; i++) {
    if (maxid[i] != maxid[i - 1]) {
      if (f < c) {
        f = c;
        poi = maxid[i - 1];
      }
      c = 0;
    } else
      c++;
  }
  printf("%d\n", poi + 1);
  return 0;
}
