#include using namespace std; int main() { char S[200]; char T[200]; int state = 0; cin >> S; int ti = 0; for (int i=0; i<102; i++) { T[ti] = S[i]; ti++; if (S[i] == 0) break; switch (S[i]) { case 't': state =1 ; break; case 'r': if (state == 1) state++; else state = 0; break; case 'e': if (state == 2 || state == 3) state++; else if (state == 6) { T[ti-7] = 'f'; T[ti-6] = 'o'; T[ti-5] = 'r'; T[ti-4] = 'e'; T[ti-3] = 's'; T[ti-2] = 't'; ti = ti - 1; state = 0; break; } else { state = 0; } break; case 'o': if (state == 4) state++; else state = 0; break; case 'n': if (state == 5) state++; else state = 0; break; } } cout << T << endl; return 0; }