#include <bits/stdc++.h>
using namespace std;
int in;
int a[105][105];
int b[100000];
int max(int l, int n) {
  int m = a[l][0];
  int in = 0;
  for (int x = 0; x < n; x++) {
    if (m < a[l][x]) {
      m = a[l][x];
      in = x;
    }
  }
  return in;
}
int main() {
  int n, m;
  cin >> n >> m;
  int i, j;
  for (i = 0; i < m; ++i)
    for (j = 0; j < n; ++j) cin >> a[i][j];
  for (j = 0; j < m; ++j) {
    b[max(j, n)] += 1;
  }
  int m1 = b[0];
  if (m != 1)
    for (i = 1; i < m; ++i) {
      if (m1 < b[i]) {
        m1 = b[i];
        in = i;
      }
    }
  else
    in = max(0, n);
  cout << (in + 1);
}
