#include #include using namespace std; int main(){ string S; cin >> S; if (S.size() < 7){ cout << S << endl; } else { int N = S.size(); string T = S.substr(0, 6); for (int i = 6; i < N; i++){ T += S[i]; if (T.size() >= 7){ if (T.substr(T.size() - 7, 7) == "treeone"){ for (int j = 0; j < 7; j++){ T.pop_back(); } T += '#'; } } } int M = T.size(); for (int i = 0; i < M; i++){ if (T[i] == '#'){ cout << "forest"; } else { cout << T[i]; } } cout << endl; } }