#include <bits/stdc++.h>
using namespace std;
long long int arr[4100][1000], brr[100000];
int main() {
  long long int t, p = 1554654465, l, n, m, mn, mx, i, sum = 0, x, y;
  cin >> m >> n;
  l = 1;
  for (i = 1; i <= n; i++) {
    x = 0;
    for (long long int j = 1; j <= m; j++) {
      cin >> arr[i][j];
      if (x < arr[i][j]) {
        x = arr[i][j];
        l = j;
      }
    }
    brr[l]++;
    l = 1;
  }
  x = 0;
  for (long long int j = 1; j <= m; j++) {
    if (x < brr[j]) {
      x = brr[j];
      l = j;
    }
  }
  cout << l << endl;
  return 0;
}
