#include <bits/stdc++.h>
using namespace std;
int win[105];
int main() {
  long long n, m, mx = -1, a, index = 0;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    mx = -1;
    for (int j = 1; j <= n; j++) {
      cin >> a;
      if (a > mx) {
        mx = a;
        index = j;
      }
    }
    win[index]++;
  }
  mx = 0;
  for (int j = 1; j <= n; j++) {
    if (win[j] > mx) {
      mx = win[j];
      index = j;
    }
  }
  cout << index << endl;
  return 0;
}
