#include <bits/stdc++.h>
using namespace std;
const int INF = 2 * 1e9;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> votes(n, 0);
  for (int i = 0; i < m; i++) {
    int cnt = -INF;
    int m_i = 0;
    for (int j = 0; j < n; j++) {
      int a;
      cin >> a;
      if (a > cnt) {
        cnt = a;
        m_i = j;
      }
    }
    votes[m_i] += 1;
  }
  int max_v = -INF;
  int max_i = 0;
  for (int i = 0; i < n; i++) {
    if (votes[i] > max_v) {
      max_v = votes[i];
      max_i = i + 1;
    }
  }
  cout << max_i << endl;
  return 0;
}
