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