#include <bits/stdc++.h>
int cmpfunc(const void* a, const void* b) { return (*(int*)a - *(int*)b); }
int main() {
  int arr[100][100] = {0};
  int arr1[100] = {0};
  int dummy[100] = {0};
  int n, m;
  int count, temp, flag, val;
  int i, j, maxCount, pos;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      scanf("%d", &arr[i][j]);
    }
  }
  maxCount = 0;
  pos = 0;
  int k1 = 0;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) dummy[j] = arr[i][j];
    qsort(dummy, n, sizeof(int), cmpfunc);
    flag = 0;
    count = 0;
    val = dummy[n - 1];
    for (j = 0; j < n; j++) {
      if (arr[i][j] == val) {
        arr1[k1] = j;
        k1++;
        break;
      }
    }
  }
  qsort(arr1, m, sizeof(int), cmpfunc);
  flag = 0;
  count = 0;
  pos = 0;
  maxCount = 0;
  for (i = 0; i < m;) {
    if (flag == 0) {
      count = 0;
      temp = arr1[i];
      i++;
      count++;
      flag = 1;
      continue;
    }
    if (arr1[i] == temp) {
      count++;
      i++;
    } else {
      flag = 0;
      if (count > maxCount) {
        maxCount = count;
        pos = i - 1;
      }
    }
  }
  if (count > maxCount) {
    maxCount = count;
    pos = i - 1;
  }
  printf("%d\n", (arr1[pos] + 1));
  return 0;
}
