Create flatten_tree.java