#include <bits/stdc++.h>
using namespace std;
int a[102];
int b[102];
int main() {
  int n, m;
  cin >> n >> m;
  int num = 0;
  for (int i = 1; i <= m; i++) {
    int q = 0;
    for (int j = 1; j <= n; j++) {
      cin >> a[j];
      q = max(q, a[j]);
    }
    for (int l = 1; l <= n; l++) {
      if (a[l] == q) {
        b[l]++;
        break;
      }
    }
  }
  int t = 0;
  for (int j = 1; j <= 100; j++) {
    t = max(t, b[j]);
  }
  for (int l = 1; l <= 100; l++) {
    if (t == b[l]) {
      cout << l;
      break;
    }
  }
}
