#include <bits/stdc++.h>
using namespace std;
char s1[100005], s2[100005], s3[100005];
int n, m, k, mod;
int a, b[1005];
double x[10], y[10];
int dp[505][505];
map<int, int> mp, mp2;
int compare(const void* a, const void* b) {
  int int_a = *((int*)a);
  int int_b = *((int*)b);
  if (int_a == int_b)
    return 0;
  else if (int_a < int_b)
    return -1;
  else
    return 1;
}
int main(int argc, const char* argv[]) {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int mn = -1;
    k = 0;
    for (int j = 0; j < n; ++j) {
      scanf("%d", &a);
      if (a > mn) {
        mn = a;
        k = j;
      }
    }
    b[k]++;
  }
  int mn = -1;
  k = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] > mn) {
      mn = b[i];
      k = i + 1;
    }
  }
  printf("%d\n", k);
  return 0;
}
