#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int cnt[100] = {0};
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int val;
    int max = -1;
    int id;
    for (int j = 0; j < n; ++j) {
      scanf("%d", &val);
      if (val > max) {
        max = val;
        id = j;
      }
    }
    cnt[id]++;
  }
  int max = -1;
  int id;
  for (int i = 0; i < n; ++i) {
    if (cnt[i] > max) {
      max = cnt[i];
      id = i;
    }
  }
  printf("%d\n", id + 1);
}
