#include <bits/stdc++.h>
using namespace std;
int grid[107][107];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) cin >> grid[i][j];
  }
  vector<int> ans;
  for (int i = 0; i < m; i++) {
    int x = grid[i][0];
    int idx = 0;
    for (int j = 1; j < n; j++) {
      if (grid[i][j] > x) {
        x = grid[i][j];
        idx = j;
      }
    }
    ans.push_back(idx);
  }
  map<int, int> cnt;
  for (int i = 0; i < ans.size(); i++) {
    if (cnt.find(ans[i]) != cnt.end())
      cnt[ans[i]] += 1;
    else
      cnt[ans[i]] = 1;
  }
  map<int, int>::iterator it;
  int curr = -1;
  int sol;
  for (it = cnt.begin(); it != cnt.end(); it++) {
    int a = it->first;
    int b = it->second;
    if (b > curr) {
      curr = b;
      sol = a;
    }
  }
  cout << sol + 1 << endl;
  return 0;
}
