#include <bits/stdc++.h>
const int maxBufSize = (10000000);
using namespace std;
long long int n, m;
long long int cnt[105];
int main() {
  long long int i, j, a, b, c, ans;
  scanf("%lld %lld", &n, &m);
  for (i = 1; i <= m; ++i) {
    a = -1, b = -1;
    for (j = 1; j <= n; ++j) {
      scanf("%lld", &c);
      if (c > a) {
        a = c;
        b = j;
      }
    }
    cnt[b]++;
  }
  ans = -1;
  a = -1;
  for (i = 1; i <= n; ++i) {
    if (cnt[i] > a) {
      a = cnt[i];
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
