#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int mat[110][110];
  for (int i = (0); i < (m); i++) {
    for (int j = (0); j < (n); j++) {
      int temp;
      cin >> temp;
      mat[i][j] = temp;
    }
  }
  map<int, int> mp;
  for (int i = (0); i < (m); i++) {
    int mx = mat[i][0];
    int ind = 0;
    for (int j = (1); j < (n); j++) {
      if (mat[i][j] > mx) mx = mat[i][j], ind = j;
    }
    mp[ind]++;
  }
  int mx = 0;
  for (__typeof((mp).begin()) it = (mp).begin(); it != (mp).end(); it++)
    mx = max(mx, it->second);
  for (__typeof((mp).begin()) it = (mp).begin(); it != (mp).end(); it++)
    if (mx == it->second) {
      cout << (it->first) + 1;
      break;
    }
  return 0;
}
