#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int n = 0, c = getchar(), f = 1;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') n = (n << 3) + (n << 1) + c - '0', c = getchar();
  return n * f;
}
int main() {
  int n, m;
  vector<int> ans(n, 0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int num;
    int max, ind;
    for (int j = 0; j < n; j++) {
      scanf("%d", &num);
      if (j == 0) {
        max = num;
        ind = 0;
      } else {
        if (num > max) {
          ind = j;
          max = num;
        }
      }
    }
    ans[ind]++;
  }
  vector<int>::iterator it;
  it = max_element(ans.begin(), ans.end());
  cout << it - ans.begin() + 1 << "\n";
  return 0;
}
