#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long arr[m][n];
  vector<pair<long long, long long>> max_of_all_cities;
  for (long long i = 0; i < m; i++) {
    long long max_ = -1;
    for (long long j = 0; j < n; j++) {
      cin >> arr[i][j];
      max_ = max(max_, arr[i][j]);
    }
    max_of_all_cities.push_back(make_pair(max_, (i + 1)));
  }
  map<long long, long long> map_of_winners;
  for (long long i = 0; i < m; i++) {
    for (long long j = 0; j < n; j++) {
      if (arr[i][j] == max_of_all_cities[i].first) {
        map_of_winners[j] = map_of_winners[j] + 1;
        break;
      }
    }
  }
  long long p = INT_MIN;
  for (auto itr = map_of_winners.begin(); itr != map_of_winners.end(); itr++) {
    p = max(p, itr->second);
  }
  for (auto itr = map_of_winners.begin(); itr != map_of_winners.end(); itr++) {
    if (itr->second == p) {
      cout << itr->first + 1;
      break;
    }
  }
  return 0;
}
