#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, can[110];
  for (int i = 1; i < 110; i++) can[i] = 0;
  cin >> n >> m;
  int in;
  for (int i = 1; i <= m; i++) {
    int mx = -5;
    for (int j = 1; j <= n; j++) {
      int x;
      cin >> x;
      if (x > mx) {
        mx = x;
        in = j;
      }
    }
    can[in]++;
  }
  int mx = -5;
  for (int i = 1; i <= n; i++) {
    if (can[i] > mx) {
      mx = can[i];
      in = i;
    }
  }
  cout << in << endl;
  return 0;
}
