// #define _GLIBCXX_DEBUG #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { // Input string S; cin >> S; // Replace for (int i = 0; i < S.size(); ) { if (S.substr(i, 7) == "treeone") { rep(j, 7) S[i + j] = "forest@"[j]; i += 7; } else ++i; } // Output for (const char& c : S) if (c != '@') cout << c; cout << endl; }