use std::io; fn main() { let input = read_line(); println!("{}", solve(input)); } fn read_line() -> String { let mut line = String::new(); io::stdin().read_line(&mut line) .expect("Failed to read line"); return line } fn solve(input: String) -> String { return input.replace("treeone", "forest") } #[test] fn test_solve() { assert_eq!(solve(String::from("treeone")), "forest"); assert_eq!(solve(String::from("treeoneone")), "forestone"); assert_eq!(solve(String::from("beet")), "beet"); }