#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, arr[101][101], x = 0, a, prr[101] = {0}, y = 0, p = 0, r;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 1; i <= m; i++) {
    x = 0, a = 0;
    for (int j = 1; j <= n; j++) {
      if (arr[i][j] > x) x = arr[i][j], a = j;
    }
    if (a == 0)
      prr[1]++;
    else
      prr[a]++;
  }
  for (int i = 1; i <= 101; i++) {
    if (prr[i] > p) p = prr[i], r = i;
  }
  cout << r;
  return 0;
}
