Tree Building - Python | SlaveCode