#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, j, c, a[101][101], b;
  map<long long int, long long int> mp;
  while (cin >> n >> m) {
    mp.clear();
    int mx = -1, pos, p;
    for (i = 1; i <= m; i++) {
      int mx1 = -1000;
      for (j = 1; j <= n; j++) {
        cin >> a[i][j];
        if (a[i][j] > mx1) {
          mx1 = a[i][j];
          p = j;
        }
      }
      mp[p]++;
    }
    for (i = 1; i <= n; i++) {
      if (mp[i] > mx) {
        mx = mp[i];
        pos = i;
      }
    }
    cout << pos << endl;
  }
  return 0;
}
