#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, temp, max, index;
  cin >> n >> m;
  int *candidates = new int[n + 1];
  fill_n(candidates, n + 1, 0);
  for (int i = 1; i <= m; ++i) {
    max = 0;
    index = 1;
    for (int j = 1; j <= n; ++j) {
      cin >> temp;
      if (temp > max) {
        max = temp;
        index = j;
      }
    }
    candidates[index]++;
  }
  max = 0;
  index = 1;
  for (int l = 1; l <= n; ++l) {
    if (candidates[l] > max) {
      max = candidates[l];
      index = l;
    }
  }
  cout << index;
}
