#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; replaceOtherStr(s, "treeone", "forest"); cout << s << endl; return 0; }