#include <bits/stdc++.h>
using namespace std;
int w, v, x;
int c[110];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    v = 0;
    w = 1;
    for (int j = 1; j <= n; ++j) {
      cin >> x;
      if (x > v) {
        v = x;
        w = j;
      }
    }
    c[w]++;
  }
  w = 1, v = 0;
  for (int i = 1; i <= n; ++i)
    if (c[i] > v) {
      v = c[i];
      w = i;
    }
  cout << w << "\n";
  return 0;
}
