#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3;
typedef int tarr[maxn];
const int lg = 20;
int n, m;
int a[maxn][maxn];
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  int num[maxn];
  memset(num, 0, sizeof(num));
  memset(a, 0, sizeof(a));
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  for (int i = 1; i <= m; i++) {
    int res = 1;
    for (int j = 2; j <= n; j++) {
      if (a[i][j] > a[i][res]) res = j;
    }
    num[res]++;
  }
  int ans = 1;
  for (int i = 2; i <= n; i++)
    if (num[i] > num[ans]) ans = i;
  cout << ans;
}
