import Control.Monad (replicateM)
import Data.List (sortBy,transpose)
import Data.Ord (comparing)

main = do
    [n,m] <- getLine >>= return . map read . words
    if all (==0) [n,m] then return () else do
        studentMarks <- replicateM n (getLine >>= return . map read . words)
            :: IO ([[Int]])
        let
            locationMarks = transpose studentMarks
            locationCounts = map (length . filter (==1)) locationMarks
            locationCountPairs = zip [1..m] locationCounts
            sortedLocations = map fst $
                sortBy (flip (comparing snd)) locationCountPairs

        putStrLn $ unwords $ map show sortedLocations

        main