#include <bits/stdc++.h>
using namespace std;
int main() {
  int candidates;
  int city;
  cin >> candidates;
  cin >> city;
  int arr[city];
  for (int i = 0; i < city; i++) {
    long long int max;
    cin >> max;
    arr[i] = 0;
    for (int j = 1; j < candidates; j++) {
      long long int votes;
      cin >> votes;
      if (votes > max) {
        arr[i] = j;
        max = votes;
      }
    }
  }
  int temp[candidates];
  for (int g = 0; g < candidates; g++) {
    temp[g] = 0;
  }
  for (int k = 0; k < city; k++) {
    temp[arr[k]]++;
  }
  int index = 0;
  int max = temp[0];
  for (int c = 1; c < candidates; c++) {
    if (temp[c] > max) {
      index = c;
      max = temp[c];
    }
  }
  cout << index + 1 << endl;
  return 0;
}
