#include <bits/stdc++.h>
using namespace std;
int a[100][100], cN[100], x = -1, u, n, m;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  x = -1;
  for (int i = 1; i <= m; i++) {
    x = -1;
    for (int j = 1; j <= n; j++) {
      if (a[i][j] > x) {
        x = a[i][j];
        u = j;
      }
    }
    cN[u]++;
    x = -1;
  }
  for (int i = 1; i <= n; i++) {
    if (cN[i] > x) {
      x = cN[i];
      u = i;
    }
  }
  cout << u;
  return 0;
}
