#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> chk(500);
  for (int i = 0; i < m; i++) {
    int mx = -1, who = -1;
    for (int j = 0; j < n; j++) {
      int foo;
      cin >> foo;
      if (foo > mx) {
        mx = foo;
        who = j + 1;
      }
    }
    chk[who]++;
  }
  int mx = -1, who = -1;
  for (int i = 0; i < 500; i++) {
    if (chk[i] > mx) {
      mx = chk[i];
      who = i;
    }
  }
  cout << who << '\n';
  return 0;
}
