#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T IN(T& num) {
  num = 0;
  char c = getchar(), f = 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = 1, c = getchar();
  while ('0' <= c && c <= '9') num = num * 10 + c - '0', c = getchar();
  if (f) num = -num;
  return num;
}
int n, m, b[107] = {0};
int main() {
  IN(n);
  IN(m);
  int maxc = -1, index;
  for (int i = 0; i < m; i++) {
    maxc = -1;
    index = 102;
    for (int j = 0; j < n; j++) {
      int x;
      IN(x);
      if (maxc < x) {
        maxc = x;
        index = j;
      }
    }
    b[index]++;
  }
  maxc = -1;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (maxc < b[i]) {
      maxc = b[i];
      ans = i;
    }
  }
  cout << (ans + 1) << endl;
  return 0;
}
