#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m) {
    long long a[m][n];
    int b[n];
    for (int i = 0; i < n; i++) b[i] = 0;
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) {
        cin >> a[i][j];
      }
    }
    for (int i = 0; i < m; i++) {
      int temp = 0, index = 0;
      for (int j = 0; j < n; j++) {
        if (temp < a[i][j]) {
          temp = a[i][j];
          index = j;
        }
      }
      b[index]++;
    }
    int temp1 = 0, index1 = 0;
    for (int i = 0; i < n; i++) {
      if (temp1 < b[i]) {
        temp1 = b[i];
        index1 = i;
      }
    }
    cout << index1 + 1 << endl;
  }
  return 0;
}
