#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  int hash[101] = {};
  int pt;
  int max;
  for (int i = 0; i < m; ++i) {
    max = 0;
    int arr[n];
    pt = 0;
    for (int i = 0; i < n; ++i) {
      cin >> arr[i];
    }
    for (int i = 0; i < n; ++i) {
      if (arr[i] > max) {
        max = arr[i];
        pt = i;
      }
    }
    hash[pt]++;
  }
  max = 0, pt = 0;
  for (int i = 0; i < 101; ++i) {
    if (hash[i] > max) {
      max = hash[i];
      pt = i;
    }
  }
  cout << pt + 1;
}
