#include #include int main() { std::string T = "treeone"; std::string F = "forest"; std::string S; std::cin >> S; size_t place = 0; size_t tree; while (place < S.length()) { tree = S.find(T, place); if (tree == -1) { break; } S.replace(tree, T.length(), F); place += tree; } std::cout << S << std::endl; return 0; }