#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
map<int, int>::iterator it;
using namespace std;
int ar[1005][1005], ar2[105];
int main() {
  int a, b;
  cin >> a >> b;
  for (int i = 0; i < b; i++) {
    int p = -1;
    int c = 0;
    for (int j = 0; j < a; j++) {
      int s;
      cin >> s;
      if (p < s) {
        p = s;
        c = j;
      }
    }
    ar2[c]++;
  }
  int sum = 0;
  for (int i = 0; i < a; i++) {
    if (ar2[sum] < ar2[i]) sum = i;
  }
  cout << sum + 1 << endl;
}
