#include <bits/stdc++.h>
using namespace std;
const int N = 200;
int n, m;
int a[N][N];
int mx[N];
int winner[N];
int cnt[N];
int W;
int Cnt;
int main(void) {
  cin >> m >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  Cnt = 0;
  W = 0;
  for (int i = 0; i < n; i++) {
    winner[i] = 0;
    mx[i] = a[i][0];
    for (int j = 1; j < m; j++) {
      if (a[i][j] > mx[i]) {
        mx[i] = a[i][j];
        winner[i] = j;
      }
    }
    cnt[winner[i]]++;
  }
  for (int i = 0; i < m; i++) {
    if (cnt[i] > Cnt) {
      Cnt = cnt[i];
      W = i;
    }
  }
  cout << W + 1 << endl;
  return 0;
}
