#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-6;
int a[1005][1005];
int vote[1005];
int main() {
  { ; };
  int n, m;
  scanf("%d %d", &n, &m);
  for (int j = 1; j <= m; j++)
    for (int i = 1; i <= n; i++) scanf("%d", &a[j][i]);
  for (int j = 1; j <= m; j++) {
    int whom = 0;
    int maxx = -1;
    for (int i = 1; i <= n; i++)
      if (a[j][i] > maxx) {
        maxx = a[j][i];
        whom = i;
      }
    vote[whom]++;
  }
  int winner = 0;
  int maxx = -1;
  for (int i = 1; i <= n; i++)
    if (vote[i] > maxx) {
      maxx = vote[i];
      winner = i;
    }
  printf("%d\n", winner);
  return 0;
}
