/*
PROBLEM: C3
LANG: C
NAME: Svilen Marchev
SCHOOL: 12 SOU, Sofia
*/

#include <stdio.h>
#include <stdlib.h>

#define MAXN		128

struct Problem {
	int p, ind;
};

int p[MAXN];
int n;

void output()
{
	int i, min;
	min = n / 2 + (n % 2);

	for (i = 0; i < n; i++) {
		if (p[i] >= min)
			printf("%d ", i + 1);
	}
}

int sortf(const void *a, const void *b)
{
	if (((Problem *)a)->ind < ((Problem *)b)->ind) return -1;
	else if (((Problem *)a)->ind == ((Problem *)b)->ind) return 0;
	return 1;
}

void solve()
{
	int i, j, m, k;
	Problem buf[MAXN];

	//freopen("0c3.in", "r", stdin);
	scanf("%d %d", &m, &n);

	for (i = 0; i < n; i++) p[i] = 0;
	for (i = 0; i < m; i++) {
		for (j = 0; j < n; j++) {
			scanf("%d", &buf[j].ind);
			buf[j].p = j;
		}

		qsort(buf, n, sizeof(buf[0]), sortf);

		k = buf[0].ind;
		for (j = 0; j < n && buf[j].ind == k; j++) {
			if (p[buf[j].p] != -1)
				p[buf[j].p]++;
		}

		k = buf[n-1].ind;
		for (j = n - 1; j >= 0 && buf[j].ind == k; j--)
			p[buf[j].p] = -1;
	}
}

int main()
{
	solve();
	output();
	return 0;
}