#include <bits/stdc++.h>
using namespace std;
long long SET(long long N, long long pos) { return N = N | (1 << pos); }
long long RESET(long long N, long long pos) { return N = N & ~(1 << pos); }
bool CHECK(long long N, long long pos) { return (bool)(N & (1 << pos)); }
template <typename T>
inline T __lcm(T a, T b) {
  return (a * b) / __gcd(a, b);
}
struct node {
  long long i, x, y;
};
long long dx[] = {0, 1, 0, -1, -1, 1, -1, 1};
long long dy[] = {1, 0, -1, 0, 1, 1, -1, -1};
long long a[101][101];
long long b[101];
void solve() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long won;
    long long cnt = -1;
    for (long long j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] > cnt) {
        cnt = a[i][j];
        won = j;
      }
    }
    b[won]++;
  }
  long long won;
  long long cnt = -1;
  for (long long i = 1; i <= n; i++) {
    if (b[i] > cnt) {
      cnt = b[i];
      won = i;
    }
  }
  cout << won << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
