(define (main args) (for-each print (let loop [(str (read-line)) (mxl 0) (ans '())] (let [(mt (rxmatch #/([^w]+)(w+)/ str))] (cond [mt (let [(mts (rxmatch-substring mt 1)) (mtl (string-length (rxmatch-substring mt 2)))] (cond [(< mxl mtl) (loop (rxmatch-after mt) mtl (list mts))] [(= mxl mtl) (loop (rxmatch-after mt) mxl (cons mts ans))] [else (loop (rxmatch-after mt) mxl ans)]))] [else (reverse ans)]) ))) 0)