#include <bits/stdc++.h>
const int maxn = 200;
int cnt[maxn];
int a[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int p = 1;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (a[i] > a[p]) p = i;
    }
    cnt[p]++;
  }
  int p = 1;
  for (int i = 2; i <= n; i++)
    if (cnt[i] > cnt[p]) p = i;
  printf("%d\n", p);
  return 0;
}
