#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.substr(T.size() - 7, 7) == "treeone"){ for (int j = 0; j < 7; j++){ T.pop_back(); } T += "forest"; } } cout << T << endl; } }