#include <bits/stdc++.h>
int L[100000];
int R[100000];
void merge(int arr[], int low, int mid, int high) {
  int i;
  int j;
  int k;
  int n1;
  int n2;
  n1 = mid - low + 1;
  n2 = high - mid;
  for (i = 0; i < n1; i++) {
    L[i] = arr[low + i];
  }
  for (j = 0; j < n2; j++) {
    R[j] = arr[mid + 1 + j];
  }
  i = 0;
  j = 0;
  k = low;
  while ((i < n1) && (j < n2)) {
    if (L[i] <= R[j]) {
      arr[k++] = L[i++];
    } else {
      arr[k++] = R[j++];
    }
  }
  while (i < n1) {
    arr[k++] = L[i++];
  }
  while (j < n2) {
    arr[k++] = R[j++];
  }
}
void mergesort(int arr[], int low, int high) {
  if (low < high) {
    int mid = low + (high - low) / 2;
    mergesort(arr, low, mid);
    mergesort(arr, mid + 1, high);
    merge(arr, low, mid, high);
  }
}
void display(int arr[], int size) {
  for (int i = 0; i < size; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}
int countoccurences(int arr[], int low, int high, int key) {
  if (low <= high) {
    int mid = low + (high - low) / 2;
    if (arr[mid] == key) {
      return (1 + countoccurences(arr, low, mid - 1, key) +
              countoccurences(arr, mid + 1, high, key));
    } else if (arr[mid] > key) {
      return (countoccurences(arr, low, mid - 1, key));
    } else {
      return (countoccurences(arr, mid + 1, high, key));
    }
  }
  return (0);
}
int main() {
  int n;
  int m;
  int mat[1000][1000];
  int firstStageWinner[1000];
  scanf("%d %d", &n, &m);
  int max;
  for (int i = 0; i < m; i++) {
    max = INT_MIN;
    firstStageWinner[i] = 0;
    for (int j = 0; j < n; j++) {
      scanf("%d", &mat[i][j]);
      if (mat[i][j] > max) {
        max = mat[i][j];
        firstStageWinner[i] = j + 1;
      }
    }
  }
  mergesort(firstStageWinner, 0, n - 1);
  max = INT_MIN;
  int winner;
  int temp;
  for (int i = 1; i <= n; i++) {
    if ((temp = countoccurences(firstStageWinner, 0, n - 1, i)) > max) {
      max = temp;
      winner = i;
    }
  }
  printf("%d\n", winner);
  return 0;
}
