Catch the root node, build a tree with root node as root, and output the tree to a Newick file.