#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[101], b[101] = {0}, c[101] = {0}, n, m, i, j, k;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    for (j = 1; j <= n; j++) {
      scanf("%d", &a[j]);
      c[j] += a[j];
    }
    k = 0;
    for (j = 1; j <= n; j++)
      if (k < a[j]) k = a[j];
    for (j = 1; j <= n; j++)
      if (a[j] == k) {
        b[j]++;
        break;
      }
  }
  j = 1;
  k = b[1];
  for (i = 2; i <= n; i++)
    if (k < b[i]) {
      k = b[i];
      j = i;
    }
  printf("%d\n", j);
  return 0;
}
