#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a > b; }
int n, m;
int a[101];
int main() {
  cin >> n >> m;
  int ti, t;
  int max = 0;
  for (int i = 0; i < m; i++) {
    int max = -1;
    for (int j = 0; j < n; j++) {
      cin >> t;
      if (t > max) {
        max = t;
        ti = j;
      }
    }
    a[ti]++;
  }
  int mx = -100, ans = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] > mx) {
      mx = a[i];
      ans = i;
    }
  }
  cout << ans + 1 << endl;
}
