#include <bits/stdc++.h>
inline long long gcd(long long a, long long b) {
  return (b ? gcd(b, a % b) : a);
}
inline long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
inline int cmp(double x, double y = 0, double tol = 1e-7) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
using namespace std;
const int MAXN = 100005;
int main() {
  int n, m;
  cin >> n >> m;
  int ans[105] = {0};
  for (int i = 0; i < m; i++) {
    int v[105];
    for (int j = 0; j < n; j++) cin >> v[j];
    int w, p = -1;
    for (int j = 0; j < n; j++) {
      if (v[j] > p) {
        p = v[j];
        w = j;
      }
    }
    ans[w]++;
  }
  int w, p = -1;
  for (int i = 0; i < n; i++) {
    if (ans[i] > p) {
      p = ans[i];
      w = i;
    }
  }
  cout << w + 1 << endl;
}
