#include <bits/stdc++.h>
using namespace std;
int a[100 + 20][100 + 20];
int s[1000];
int win[1000];
int main() {
  int n, m, maxa = 0, winner = 1;
  cin >> n >> m;
  int maxcity = 0;
  for (int i = 1; i <= m; i++) {
    maxa = 1;
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] > a[i][maxa]) maxa = j;
    }
    win[maxa]++;
  }
  for (int j = 1; j <= n; j++) {
    if (win[j] > win[winner]) winner = j;
  }
  cout << winner << endl;
  return 0;
}
