import java.util.*; public class Main { public static String word = "treeone"; public static void main(String args[]) { Scanner scan = new Scanner(System.in); String n = scan.hasNextLine() ? scan.nextLine() : null; // 小文字のみ String regex_Alphabet = "^[a-z]+$"; if (n.length() > 100 || n.length() < 1 || !n.matches(regex_Alphabet)) { System.out.println("入力エラー1"); return; } String ans = n.replace(word,"forest"); // 結果出力 System.out.println(ans); } }