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