結果 : how to take tree as input in python