#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int num[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int vote = -1, ind = -1;
    for (int j = 0; j < n; j++) {
      int t;
      cin >> t;
      if (t > vote) {
        vote = t;
        ind = j;
      }
    }
    num[ind]++;
  }
  int vote = -1, ind = -1;
  for (int i = 0; i < n; i++)
    if (num[i] > vote) {
      vote = num[i];
      ind = i;
    }
  cout << ind + 1 << "\n";
  return 0;
}
