#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int, int>& p1, const pair<int, int>& p2) {
  return (p1.first == p2.first) ? (p1.second > p2.second)
                                : (p1.first < p2.first);
}
pair<long long, int> A[1000], B[1000];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < (m); i++) {
    for (int i = 0; i < (n); i++) {
      scanf("%I64d", &B[i].first);
      B[i].second = i;
    }
    sort(B, B + n, &cmp);
    A[B[n - 1].second].first++;
  }
  for (int i = 0; i < (n); i++) A[i].second = i;
  sort(A, A + n, &cmp);
  printf("%d\n", A[n - 1].second + 1);
  return 0;
}
