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