#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > points;
int a[101][101];
int len[110];
vector<pair<int, int> > temp;
vector<pair<int, int> > v;
vector<int> pp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  int temp[101];
  memset(temp, 0, sizeof temp);
  for (int i = 0; i < m; i++) ++temp[max_element(a[i], a[i] + n) - a[i]];
  cout << max_element(temp, temp + n) - temp + 1 << endl;
}
