let equal s i t = let n = String.length s in let m = String.length t in i + m <= n && String.sub s i m = t;; let () = let s = read_line () in let n = String.length s in let ans = Buffer.create 0 in let i = ref 0 in while !i < n do if equal s !i "treeone" then begin Buffer.add_string ans "forest"; i := !i + 7 end else begin Buffer.add_char ans s.[!i]; incr i end done; print_endline (Buffer.contents ans)