#include <bits/stdc++.h>
using namespace std;
int n, c, a, mx, ind;
pair<int, int> sol;
vector<int> arr(103, 0);
int main() {
  sol = make_pair(-1, 10000);
  scanf("%d%d", &n, &c);
  for (int i = 0; i < c; i++) {
    for (int j = 1; j <= n; j++) {
      scanf("%d", &a);
      if (j == 1) {
        mx = a;
        ind = 1;
      }
      if (a > mx) {
        mx = a;
        ind = j;
      }
    }
    arr[ind]++;
    if (sol.first < arr[ind]) {
      sol.first = arr[ind];
      sol.second = ind;
    } else if (sol.first == arr[ind] && sol.second > ind)
      sol.second = ind;
  }
  printf("%d\n", sol.second);
  return 0;
}
