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