#include <bits/stdc++.h>
using namespace std;
int n, m, a, sum[105], maxn = -1, Max, ans;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    Max = ans = -1;
    for (int j = 1; j <= n; j++) {
      cin >> a;
      if (a > Max) {
        Max = a;
        ans = j;
      }
    }
    sum[ans]++;
  }
  for (int i = 1; i <= n; i++) {
    maxn = max(maxn, sum[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (sum[i] == maxn) {
      cout << i;
      return 0;
    }
  }
  return 0;
}
