#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0;
  bool ok = 0;
  char c = getchar();
  while (c < 48 || c > 57) ok |= (c == '-'), c = getchar();
  while (c > 47 && c < 58) x *= 10, x += c - 48, c = getchar();
  if (ok) x = -x;
  return x;
}
void print(int x, int y = 0) {
  printf("%d", x);
  if (y == 0)
    puts("");
  else
    putchar(' ');
}
void printll(long long x, int y = 0) {
  printf("%I64d", x);
  if (y == 0)
    puts("");
  else
    putchar(' ');
}
string read_s() {
  string s = "";
  char c = getchar();
  while (!isalpha(c) && !isdigit(c)) c = getchar();
  while (isalpha(c) || isdigit(c)) s += c, c = getchar();
  return s;
}
void prints(string x) {
  char s[100002];
  for (int i = 0; i < x.size(); i++) s[i] = x[i];
  s[x.size()] = '\0';
  puts(s);
}
int a[100][100], t[100];
int main() {
  int n = read(), m = read();
  set<pair<int, int> > ans;
  for (int i = 0; i < m; i++) {
    set<pair<int, int> > s;
    for (int j = 0; j < n; j++) {
      a[i][j] = read();
      s.insert({a[i][j], -j});
    }
    int x = -(*s.rbegin()).second;
    t[x]++;
  }
  int x = -1, p = 0;
  for (int i = 0; i < 100; i++)
    if (t[i] > x) x = t[i], p = i;
  print(p + 1);
}
