#include <bits/stdc++.h>
using namespace std;
int b[110];
int main() {
  int n, m, i, j, a[110][110];
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) scanf("%d", &a[i][j]);
  }
  int maxi = 0;
  for (i = 0; i < m; i++) {
    maxi = -1;
    for (j = 0; j < n; j++)
      if (a[i][j] > maxi) maxi = a[i][j];
    for (j = 0; j < n; j++)
      if (a[i][j] == maxi) {
        b[j]++;
        break;
      }
  }
  maxi = -1;
  for (i = 0; i < n; i++)
    if (b[i] > maxi) {
      maxi = b[i];
      j = i + 1;
    }
  cout << j << endl;
  return 0;
}
