#include <bits/stdc++.h>
using namespace std;
const int maxn = 15000;
int d[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int maxx = -1, maxi = 0;
    int x;
    for (int j = 1; j <= n; j++) {
      scanf("%d", &x);
      if (x > maxx) {
        maxx = x;
        maxi = j;
      }
    }
    d[maxi]++;
  }
  int ans = 1;
  for (int i = 1; i <= n; i++) {
    if (d[i] > d[ans]) {
      ans = i;
    }
  }
  printf("%d\n", ans);
  return 0;
}
