#include <bits/stdc++.h>
using namespace std;
long long int a[101][101], f[101], ans[101];
int main() {
  int n, m;
  cin >> n >> m;
  memset(a, 0, sizeof(a));
  memset(f, 0, sizeof(f));
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= m; i++) {
    int t, t1, mv = -1;
    for (int j = 1; j <= n; j++) {
      if (a[i][j] > mv) {
        mv = a[i][j];
        t = i;
        t1 = j;
      }
    }
    f[t] = t1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i == f[j]) ans[i]++;
    }
  }
  int max(0), out(1);
  ;
  for (int i = 1; i <= n; i++) {
    if (ans[i] > max) {
      max = ans[i];
      out = i;
    }
  }
  cout << out;
}
