#include <bits/stdc++.h>
using namespace std;
int a[111][111], can[111], qnt[111], n, m;
int main() {
  while (scanf("%d %d", &n, &m) != EOF) {
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) {
        scanf("%d", &a[i][j]);
      }
    }
    for (int i = 0; i < m; i++) {
      int max_ = -1;
      for (int j = 0; j < n; j++) {
        if (a[i][j] > max_) {
          max_ = a[i][j];
          can[i] = j;
        }
      }
    }
    memset(qnt, 0, sizeof(qnt));
    for (int i = 0; i < m; i++) {
      qnt[can[i]]++;
    }
    int max_ = -1, resp = -1;
    for (int i = 0; i < n; i++) {
      if (qnt[i] > max_) {
        max_ = qnt[i];
        resp = i;
      }
    }
    printf("%d\n", resp + 1);
  }
  return 0;
}
