#include <bits/stdc++.h>
using namespace std;
bool isPrime(int t) {
  for (int i = 2; i < t; ++i) {
    if (t % i == 0) return false;
  }
  return true;
}
int main() {
  int mas[101][101];
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> mas[i][j];
    }
  }
  int cond[101];
  memset(cond, 0, sizeof(cond));
  for (int i = 0; i < m; ++i) {
    int win = 0, sz = -1;
    for (int j = 0; j < n; ++j) {
      if (mas[i][j] > sz) {
        sz = mas[i][j];
        win = j + 1;
      }
    }
    cond[win]++;
  }
  int win = 0;
  int sz = -1;
  for (int i = 1; i <= n; ++i) {
    if (cond[i] > sz) sz = cond[i], win = i;
  }
  cout << win << endl;
  return 0;
}
