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