#include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string str; cin >> str; string tree = "treeone"; string fore = "forest"; for (int i = 0; i < str.size(); ++i) { for (int j = 0; j < tree.size(); ++j) { if (str[i + j] != tree[j]) break; if (j == tree.size() - 1) { for (int k = 0; k < fore.size(); ++k) { str[i + k] = fore[k]; } for (auto k = fore.size(); k < tree.size(); ++k) { str[i + k] = '7'; } } } } for (int i = 0; i < str.size(); ++i) { if (str[i] == '7') continue; cout << str[i]; } cout << endl; }