#include #include using namespace std; int main() { string s; string from = "treeone"; string to = "forest"; cin >> s; string::size_type pos = 0; while ((pos = s.find(from, pos)) != string::npos) { s.replace(pos, from.length(), to); pos += to.length(); } cout << s << endl; return 0; }