#include <bits/stdc++.h>
using namespace std;
void fastIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
}
long long A[1000][1000];
long long Max_value[100006];
long long C[100006];
long long rev(long long a, long long b) { return a > b; }
int main() {
  fastIO();
  vector<long long> V;
  set<long long> S;
  set<long long>::iterator it;
  map<string, long long> M;
  map<string, long long>::iterator it1;
  long long a, b, c;
  long long n, m;
  long long cnt = 0, cntr = 0, sum = 0, ans = 1;
  long long p, q, r;
  long long v = 1;
  long long check = 0;
  long long x, y, z;
  long long Max = 0;
  string s, s1[100006], s2[100006], s3, s4;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    Max = 0;
    for (int j = 1; j <= n; j++) {
      cin >> A[i][j];
      Max = max(Max, A[i][j]);
    }
    Max_value[i] = Max;
  }
  long long Max_vote = 0;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (A[i][j] == Max_value[i]) {
        C[j]++;
        Max_vote = max(Max_vote, C[j]);
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (C[i] == Max_vote) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
