#include <bits/stdc++.h>
using namespace std;
const int max_n = 110;
int a[max_n][max_n];
int ans[max_n];
int cnt[max_n];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int ma = 0;
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] > a[i][ma]) {
        ma = j;
      }
    }
    ans[i] = ma;
  }
  int an = 0;
  for (int i = 0; i < m; i++) {
    cnt[ans[i]]++;
  }
  for (int i = 0; i < n; i++) {
    if (cnt[i] > cnt[an]) {
      an = i;
    }
  }
  cout << an + 1 << endl;
  return 0;
}
