solutions to lgis and tree