#include <bits/stdc++.h>
using namespace std;
int n, m, len;
int arr[110];
int brr[110];
int main() {
  int i, j, k, t, a, b;
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    memset(arr, 0, sizeof(arr));
    for (j = 0; j < n; j++) {
      cin >> arr[j];
    }
    int winner = -1;
    int maxz = -1;
    for (j = 0; j < n; j++) {
      if (arr[j] > maxz) {
        maxz = arr[j];
        winner = j;
      }
    }
    brr[winner]++;
  }
  int winner = -1;
  int maxz = -1;
  for (i = 0; i < n; i++) {
    if (brr[i] > maxz) {
      maxz = brr[i];
      winner = i;
    }
  }
  cout << winner + 1 << "\n";
  return 0;
}
