#include <bits/stdc++.h>
using namespace std;
int main() {
  int temp[101][101];
  int rank[101];
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) cin >> temp[i][j];
  for (int i = 0; i < n; i++) rank[i] = 0;
  for (int i = 0; i < m; i++) {
    int maxin = temp[i][0], maxp = 0;
    for (int j = 1; j < n; j++) {
      if (maxin < temp[i][j]) {
        maxin = temp[i][j];
        maxp = j;
      }
    }
    rank[maxp]++;
  }
  int result = rank[0], resultp = 0;
  for (int i = 1; i < n; i++)
    if (rank[i] > result) {
      result = rank[i];
      resultp = i;
    }
  cout << resultp + 1;
}
