#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[101] = {0};
  int x, y;
  for (int i = 0; i < m; i++) {
    int max = 1;
    cin >> x;
    int maxsum = x;
    for (int i = 2; i <= n; i++) {
      cin >> x;
      if (x > maxsum) {
        max = i;
        maxsum = x;
      }
    }
    a[max]++;
  }
  int re = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i] > a[re]) re = i;
  }
  cout << re << endl;
  return 0;
}
