#include <bits/stdc++.h>
using namespace std;
int dp[105][105];
int vote[105];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    memset(vote, 0, sizeof vote);
    for (int i = 1; i <= m; i++) {
      for (int j = 1; j <= n; j++) {
        scanf("%d", &dp[i][j]);
      }
    }
    int max = -1, pep = 0;
    for (int i = 1; i <= m; i++) {
      for (int j = 1; j <= n; j++) {
        if (max < dp[i][j]) {
          max = dp[i][j];
          pep = j;
        }
        if (j == n) vote[pep]++;
      }
      max = -1, pep = 0;
    }
    for (int i = 1; i <= n; i++) {
      if (max < vote[i]) {
        max = vote[i];
        pep = i;
      }
    }
    printf("%d\n", pep);
  }
  return 0;
}
