#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int T[m + 1][n + 1];
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) scanf("%d", &T[i][j]);
  map<int, int> M;
  for (int i = 1; i <= m; i++) {
    int Max = -1, indx;
    for (int j = 1; j <= n; j++) {
      if (T[i][j] > Max) Max = T[i][j], indx = j;
    }
    M[indx]++;
  }
  int Max = 0, ans = 1;
  for (int i = 1; i <= n; i++) {
    if (M[i] > Max) Max = M[i], ans = i;
  }
  printf("%d", ans);
  return 0;
}
