#include <bits/stdc++.h>
int vis[105];
int main() {
  int n, m, k, k1, max1, a;
  while (~scanf("%d%d", &n, &m)) {
    memset(vis, 0, sizeof(vis));
    for (int i = 1; i <= m; i++) {
      max1 = -1;
      for (int j = 1; j <= n; j++) {
        scanf("%d", &a);
        if (max1 < a) {
          max1 = a;
          k = j;
        }
      }
      vis[k]++;
    }
    max1 = -1;
    for (int i = 1; i <= n; i++) {
      if (max1 < vis[i]) {
        max1 = vis[i];
        k1 = i;
      }
    }
    printf("%d\n", k1);
  }
  return 0;
}
