#include <bits/stdc++.h>
using namespace std;
int b[10000] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  long int n, m, max, max1;
  cin >> n >> m;
  long long int a;
  for (int i = 0; i < m; i++) {
    max1 = -1;
    for (int j = 0; j < n; j++) {
      cin >> a;
      if (a > max1) {
        max = j;
        max1 = a;
      }
    }
    b[max]++;
  }
  for (int i = 0; i < n; i++) {
    if (b[i] == *max_element(b, b + n)) {
      cout << i + 1;
      return 0;
    }
  }
  return 0;
}
