#include <bits/stdc++.h>
using namespace std;
int num[110];
int main() {
  int n, m;
  cin >> n >> m;
  while (m--) {
    int mx = -1, index = -1;
    for (int i = 1; i <= n; i++) {
      int t;
      cin >> t;
      if (t > mx) {
        mx = t;
        index = i;
      }
    }
    num[index]++;
  }
  int mx = -1, index = -1;
  for (int i = 1; i <= n; i++)
    if (num[i] > mx) {
      mx = num[i];
      index = i;
    }
  cout << index;
}
