#include <bits/stdc++.h>
using namespace std;
struct node {
  int sum;
  int index;
  bool operator<(const node b) const {
    if (sum != b.sum) return sum > b.sum;
    return index < b.index;
  }
} s[111];
int main() {
  int n, m, a[111][111];
  cin >> m >> n;
  memset(s, 0, sizeof(s));
  for (int i = 0; i < n; i++) {
    int maxx = -99999, maxj;
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
      if (a[i][j] > maxx) {
        maxx = a[i][j];
        maxj = j;
      }
    }
    s[maxj].sum++;
  }
  for (int i = 0; i < m; i++) {
    s[i].index = i + 1;
  }
  sort(s, s + m);
  cout << s[0].index << endl;
  return 0;
}
