#include #include using namespace std; string replaceOtherStr(string &replacedStr, string from, string to) { const unsigned int pos = replacedStr.find(from); const int len = from.length(); if (pos == std::string::npos || from.empty()) { return replacedStr; } return replacedStr.replace(pos, len, to); } int main(){ string s; cin >> s; bool flg = 0; for(int i = 0; i < s.length() - 7; i++){ if(s.compare(i, 7, "treeone") == 0){ flg = 1; break; } } if(flg) replaceOtherStr(s, "treeone", "forest"); cout << s << endl; return 0; }