#include <bits/stdc++.h>
using namespace std;
template <class t>
inline t read(t &x) {
  char c = getchar();
  bool f = 0;
  x = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
template <class t>
inline void write(t x) {
  if (x < 0)
    putchar('-'), write(-x);
  else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
template <class t>
inline void writeln(t x) {
  write(x);
  putchar('\n');
  return;
}
template <class t>
inline void write_blank(t x) {
  write(x);
  putchar(' ');
  return;
}
int n, m, a[110][110], Statistics[110];
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      read(a[i][j]);
    }
  }
  int ans = -0x7fffffff, id;
  for (int i = 1; i <= m; i++) {
    ans = a[i][1];
    id = 1;
    for (int j = 2; j <= n; j++) {
      if (a[i][j] > ans) {
        ans = a[i][j];
        id = j;
      }
    }
    Statistics[id]++;
  }
  ans = -0x7fffffff;
  for (int i = 1; i <= n; i++) {
    ans = max(Statistics[i], ans);
  }
  for (int i = 1; i <= n; i++) {
    if (Statistics[i] == ans) {
      write(i);
      return 0;
    }
  }
  return 0;
}
