#include <bits/stdc++.h>
using namespace std;
long long int arr[500];
int main() {
  int i, j, canditate, city, ind, MAX, total[500];
  long long int max;
  while (cin >> canditate >> city) {
    MAX = 0;
    for (i = 0; i <= canditate; i++) total[i] = 0;
    for (i = 0; i < city; i++) {
      max = -1;
      for (j = 1; j <= canditate; j++) {
        cin >> arr[j];
        if (max < arr[j]) {
          max = arr[j];
          ind = j;
        }
      }
      total[ind]++;
    }
    max = 0;
    for (i = 1; i <= canditate; i++) {
      if (max < total[i]) {
        max = total[i];
        ind = i;
      }
    }
    cout << ind << "\n";
  }
  return 0;
}
