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

#define Max     128

 int n, p;
 int A[Max][Max];
 int s[Max];
 int buf[Max], bend;
 int cant[Max];

 void readf(void){
      int i, j;
 //     freopen("test.in", "r", stdin);
      scanf("%d %d", &n, &p);
      for(i = 0; i < n; i++)
            for(j = 0; j < p; j++)
                  scanf("%d", &A[i][j]);
 }

 void solve(void){
      int i, j, k, min, max;
      readf();
      for(i = 0; i < n; i++){
            max = A[i][0];
            for(j = 0; j < p; j++){
                  if( max < A[i][j] )
                      max = A[i][j];
            }
            for(j = 0; j < p; j++){
                  if( max == A[i][j] )
                      cant[j] = 1;
            }
      }
      for(i = 0; i < n; i++){
            min = A[i][0];
            for(j = 0; j < p; j++){
                  if(min > A[i][j])
                         min = A[i][j];
            }
            for(j = 0; j < p; j++){
                  if(min == A[i][j])
                         s[j]++;
            }
      }
      for(i = 0; i < p; i++){
            if( s[i] >= (n/2+n%2) && !cant[i] )
                buf[bend++] = i+1;
      }
      for(i = 0; i < bend-1; i++)
            printf("%d ", buf[i]);
      printf("%d\n", buf[i]);
 }

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