use std::io::Read; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); let s: Vec = s.lines().last().unwrap().chars().collect(); let a = s .windows(2) .enumerate() .flat_map(|(i, c)| if c == ['x', 'o'] { Some(i + 2) } else { None }) .collect::>(); println!( "{}\n{}", a.len(), a.iter() .map(|x| x.to_string()) .collect::>() .join(" ") ); }