Forest to binary tree