import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] array = sc.next().split(""); List res = new ArrayList<>(); List target = new ArrayList<>(); for (String str : array) { if (target.size() != 7) { target.add(str); } else { if (String.join("", target).equals("treeone")) { str = "forest"; } } res.add(str); } } }