(define (solve n s) (let loop ([l '()] [i 0] [c #\x]) (cond [(= i n) (reverse l)] [(and (char=? #\x c) (char=? #\o (string-ref s i))) (loop (cons (+ i 1) l) (+ i 1) (string-ref s i))] [else (loop l (+ i 1) (string-ref s i))]))) (define (main args) (let* ([n (read)] [s (symbol->string (read))]) (let1 l (solve n s) (print (length l)) (if (not (null? l)) (print (string-join (map number->string l) " "))))) 0)